Docsity

B632 Lecture 11 Analysis: Nested F-test and Dummy Variable Analysis, Study notes of Quantitative Techniques

Toggle sidebar
bg1
* This is a do-file for the analysis for B632 lecture 11, April 4 2006
clear
set mem 1000
use "/Users/hjs/Documents/Bush School Classes/Bush 632 2006/Bush 632 2006
lectures/B632_lecture_8/B632_scientist.dta"
* Homework #1 (nested F-test) analysis
* Now run the simple model
regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io, beta
* Now run the more complex model
regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io c4_32_ct, beta
* These model results produce the information needed to conduct the nested-F test
* Clearly the certainty variable is important. The mre certain the respondent, the
higher the
* expected temperature change.
vif
hettest
ovtest
* The VIF and linearity test look ok -- but what gives with the hettest?
* Homework #2 (dummy variable) analysis
tab c5_5a
sum c5_3_age
tab c5_4_gen
tab c5_1a
tab c5_6_exp
* Now a baseline regression with no gender variables:
regress c5_5a c5_3_age c5_1a, beta
* Now run it with only an intercept dummy:
regress c5_5a c5_3_age c5_1a c5_4_gen, beta
* Now create the interaction term: gender * education
gen gen_ed= c5_1a * c5_4_gen
tab gen_ed c5_4_gen
* Interaction terms. Does education operate the same way for for male and female
scientists?
regress c5_5a c5_3_age c5_1a c5_4_gen gen_ed, beta
* Nope -- once the intercept is accounted for, education adds as much to womenn
scientists'
* salary as it does to men scientists' salaries.
* But be cautious -- look at the VIF:
vif
hettest
ovtest
* You could do a nested F-test... that would confirm the absence of an interacive
slope effect.
docsity.com
pf3

Partial preview of the text

Download B632 Lecture 11 Analysis: Nested F-test and Dummy Variable Analysis and more Study notes Quantitative Techniques in PDF only on Docsity!

  • This is a do-file for the analysis for B632 lecture 11, April 4 2006

clear set mem 1000 use "/Users/hjs/Documents/Bush School Classes/Bush 632 2006/Bush 632 2006 lectures/B632_lecture_8/B632_scientist.dta"

  • Homework #1 (nested F-test) analysis

  • Now run the simple model

regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io, beta

  • Now run the more complex model

regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io c4_32_ct, beta

  • These model results produce the information needed to conduct the nested-F test

  • Clearly the certainty variable is important. The mre certain the respondent, the higher the

  • expected temperature change.

vif hettest ovtest

  • The VIF and linearity test look ok -- but what gives with the hettest?

  • Homework #2 (dummy variable) analysis

tab c5_5a sum c5_3_age tab c5_4_gen tab c5_1a tab c5_6_exp

  • Now a baseline regression with no gender variables:

regress c5_5a c5_3_age c5_1a, beta

  • Now run it with only an intercept dummy:

regress c5_5a c5_3_age c5_1a c5_4_gen, beta

  • Now create the interaction term: gender * education

gen gen_ed= c5_1a * c5_4_gen tab gen_ed c5_4_gen

  • Interaction terms. Does education operate the same way for for male and female scientists?

regress c5_5a c5_3_age c5_1a c5_4_gen gen_ed, beta

  • Nope -- once the intercept is accounted for, education adds as much to womenn scientists'

  • salary as it does to men scientists' salaries.

  • But be cautious -- look at the VIF:

vif hettest ovtest

  • You could do a nested F-test... that would confirm the absence of an interacive slope effect.
  • So: stick with the intercept OR slope dummy; multicolinearity clouds our ability to test for
  • both slope and intercept differneces simultaneously (why?)

  • General diagnostic steps

  • Univariate plots --- focusing here on the dependent variable

histogram c4_31_tc pnorm c4_31_tc

  • A bi-variate scatter plot can be particularly useful

graph matrix c4_31_tc c4_1_ide c4_3_env c5_3_age c4_32_ct

  • Looking specifically at the predicted values and residuals is essential. After running the model
  • these can be generated as follows:

regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io c4_32_ct, beta predict e, resid predict yhat

histogram e rvfplot

  • The most general avplot c4_32_ct

ovtest, rhs

acprplot c4_1_ide, mspline msopts (bands(7)) acprplot c4_3_env, mspline msopts (bands(7)) acprplot c5_3_age, mspline msopts (bands(7)) acprplot c4_7_un_, mspline msopts (bands(7)) acprplot c4_14_co, mspline msopts (bands(7)) acprplot c4_25_io, mspline msopts (bands(7)) acprplot c4_32_ct, mspline msopts (bands(7))

  • These runs show that c5_3_age is the most likely candidate for non-linearity. The international
  • cooperation variable () ma also be a culprit -- but it's not so systematic (it bounces)

hettest

hettest c4_1_ide hettest c4_3_env hettest c5_3_age hettest c4_7_un_ hettest c4_14_co hettest c4_25_io hettest c4_32_ct

regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io c4_32_ct, beta robust

  • Outlier analysis -- produce dfbetas for all esstimated parameters (but rerun the standard
  • OLS model first!

regress c4_31_tc c4_1_ide c4_3_env c5_3_age c4_7_un_ c4_14_co c4_25_io c4_32_ct, beta

dfbeta graph box c4_1_ide c4_3_env, legend(cols(2)) graph box c5_3_age c4_7_un_ c4_14_c, legend(cols(3)) graph box c4_14_co c4_25_io c4_32_ct, legend(cols(3))