Basic question from Matlab beginner

5 ビュー (過去 30 日間)
Nisse
Nisse 2014 年 3 月 6 日
コメント済み: Nisse 2014 年 3 月 6 日
I have data on Wage, Age, Years of Schooling and Gender. I then do a simple OLS regression of
Wage = b0 + b1Age +b2Age_sq+b3Years_of_schooling+b4Gender
I then obtain the expected wage, the coefficient estimates and the standard errors. This I have done. I am now stuck on a more basic question:
I want to plot the expected wage against Age for individuals with 5 years of schooling separately for Boys and Girls (one line for each gender). I also want to include the confidence intervals in this plot. I have spent way too long trying to figure this out. Would any kind individual care to help me?
Thanks, Nisse

回答 (2 件)

Marc
Marc 2014 年 3 月 6 日
For plotting Wage vs. Age, see anonymous functions ('@'). You can define the range for your age and using the coeficients you found along with your other fixed values, you can get estimated wages.
As for confidence intervals, this is way more tricky. Do you have the stats toolbox? The function regress() may help but you are going to have to take some liberties and make some assumptions. Your confidence around age would be better if your data is focused on fixing the other variables.
So depending on how you got your data and how you fit your parametric model will determine how well your confidence is in your estimates.
  2 件のコメント
Marc
Marc 2014 年 3 月 6 日
This may not apply but Baysian estimation may be something to look at.
Nisse
Nisse 2014 年 3 月 6 日
I am drawing a blank on how to plot Wage vs. Age while fixing the values of the other columns in the X matrix (that hold all the explanatory variables). I have tried solving this problem for days now, and am really looking for the beginning of a code that will do it. As long as I have the first part of such a code I think I can solve it myself

サインインしてコメントする。


Chandrasekhar
Chandrasekhar 2014 年 3 月 6 日
plot(age1,wage1); %for 1st person
hold
plot(age2,wage2);for 2ns person
...
....

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by