I have a data set like this:
df
Income Education_in_years
40,000 10
50,000 9
70,000 12
30,000 5
100,000 20
I would like to create a bivariate distribution from this and try to guess probability of income given eduction in years.
I can build the linear model as follows:
lin <- lm(Income~Eduction_in_years, data=df)
I could come up with a formula like this:
Income = a*education_in_years + e
What I would like to do is, given the model, create a bivariate normal, and run a 'what-if' analysis to determine income
given eduction_in_years
.
Can somebody walk me through how to create a bivariate normal distribution from this dataset and determine the income level given the education?
lm
does not treat the data as bivariate normal, so you seem to be asking to do to different things at once. Do you want to predict income from education or do you want to model the bivariate distribution of the (income, distribution) pairs? $\endgroup$