2
$\begingroup$

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?

$\endgroup$
6
  • 2
    $\begingroup$ We welcome questions like this, but we treat them differently than others. Please tell us what you understand thus far, what you've tried and where you are stuck, and we'll try to provide hints to get you unstuck. To better understand the process, please read the wiki for the self-study tag. $\endgroup$
    – whuber
    Commented Dec 6, 2013 at 20:39
  • $\begingroup$ @whuber, I've updated the post. Does that help? $\endgroup$ Commented Dec 6, 2013 at 20:45
  • 2
    $\begingroup$ Thank you; it's better. But it is also confusing: this model underlying 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$
    – whuber
    Commented Dec 6, 2013 at 20:54
  • $\begingroup$ Model bivariate distribution $\endgroup$ Commented Dec 6, 2013 at 21:24
  • $\begingroup$ Why bivariate normal? Neither incomes nor years of education are remotely normal. Both are skew (the second often left-skew), and "years of education" is distinctly discrete and sometimes noticeably multimodal. $\endgroup$
    – Glen_b
    Commented Dec 7, 2013 at 0:58

1 Answer 1

2
$\begingroup$

Simple linear regression is based on a bivariate normal model. However, in practice, we assume the independent variables are fixed/known and we are finding the conditional distribution of Y at each X. This is what you are looking for, so just apply simple regression and you will get your answer. However, if you would like to assume the X and Y are random and follow a joint normal distribution, then you need to do some more work.

Have you taken a look a the Bivariate Normal density? It specifically has parameters for the marginal means, variances, and the correlation between the two variables. You can estimate each of these quantities from your current data to get an estimated joint normal distribution. For a more sophisticated approach, you can create a prediction region for the next observation of X and Y and see what prediction probability the formula assigns to different . This is not as simple as just "plugging in" your estimates, but it will account for the error in using estimated parameters, which yhou are not doing by just plugging in. This paper has a formula for multivariate prediction regions, see equation (2.2)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.