final lecture integrating factor analysis & logit models

6
Final Lecture Integrating factor analysis & logit models

Upload: warren-lyons

Post on 24-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Final Lecture Integrating factor analysis & logit models

Final Lecture

Integrating factor analysis & logit models

Page 2: Final Lecture Integrating factor analysis & logit models

Producing & Saving Factor Scores

• Both R and Stata permit you to save factor scores• In R (starting with “complete_data” and renamed CT variables):

– CT_set<-data.frame(Eg1, Eg2, Eg3, Hi1, Hi2, Hi3, In1, In2, In3) – CT<-factanal(CT_set, factors=3, scores=c("regression"), rotation="varimax")– print(CT, digits=2, cutoff=.3, sort=TRUE) # we can see the way the CT variables – loaded on each factor– summary(CT$scores) # This shows the 3 factor scores– CT_factors<-CT$scores # Now save the scores for use in the next step– new_CT<-data.frame(complete_data, CT_factors) # now we dump the FS into

the dataset

Page 3: Final Lecture Integrating factor analysis & logit models

The Stata version

• In Stata, use the drop-down menus and options– But if you want the commands…

• factor e92_egal_1 e93_indiv1 e94_hier1 e95_egal2 e96_indiv2 e97_hier2 e98_egal3 e99_indiv3 e100_hier3, ml factors(3)

• rotate• predict EgalF IndivF HierF, regression

• logit e28_gcc EgalF IndivF HierF e1b_edu_rec e2_age e3_gend e124_ideol

Page 4: Final Lecture Integrating factor analysis & logit models

Logits with Factor Scores

• R version:– logit1<-glm(gcc ~

Factor1+Factor2+Factor3+gender+age+educ, family=binomial)

• Stata version:– logit e28_gcc EgalF IndivF HierF e1b_edu_rec e2_age

e3_gend e124_ideol

Page 5: Final Lecture Integrating factor analysis & logit models

Beyond…

• Reversing the logits– Use Excel• Calculate mean values of IVs• Multiply by estimated coefficients• Calculate L and reverse it =1/(1+exp(-L))• Vary each IV, holding all others at their mean

– Calculating “types”• Conservative, Male, Hierarch… etc

Page 6: Final Lecture Integrating factor analysis & logit models

Final Quiz

• Posted Wednesday, May 6th

• Will require a simple factor analysis– Using NS08 dataset

• Will use factor analysis in logit model• Will require interpretation of the logit– Extra credit for reversing the logit

• Will be due Tuesday, May 12th, at noon• Will be the shortest exam for this class.– Really.