* Homework # 9 -- Logistic regression. * Sample: GSS 1972-1991, Married Southern Baptists, ages 20-25. * Make sure following file name is correct. Get FILE='D:\SOC63993\HOMEWORK\LRB.sav'. DESCRIPTIVES VARIABLES=happymar church female educ /STATISTICS=MEAN STDDEV MIN MAX . * Part I. First work with non-centered variables. LOGISTIC REGRESSION VAR = HAPPYMAR / ENTER CHURCH FEMALE EDUC/ CASEWISE PRED RESID SRESID. * Now use Nomreg to get some info not available from Logistic Regression. * First, we'll flip coding so NomReg reference is less happy. * Then, compute a var equal to casenum. By including and not including * this var in the right places on NOMREG, we'll force it to treat each * case as a separate subpopulation; results will then be consistent with * Logistic Regression and other programs. Recode Happymar (0 = 2)(1 = 1) into Happymr2. Compute Casenum = $Casenum. NOMREG happymr2 WITH educ female church casenum /CRITERIA = CIN(95) DELTA(0) MXITER(100) MXSTEP(5) CHKSEP(20) LCONVERGE(0) PCONVERGE(1.0E-6) SINGULAR(1.0E-8) /MODEL educ female church /INTERCEPT = INCLUDE /PRINT = PARAMETER SUMMARY LRT . ***************************************************************************. * Part II. Now we work with centered variables. * Create a new variable, EDUCX, in which education is * centered about its mean. Rerun the above regression * using Educx. Compute EducX = Educ - 12.28. LOGISTIC REGRESSION VAR = HAPPYMAR / ENTER CHURCH FEMALE EDUCX. * Next, compute the interaction CHEDUCX. Add it to the above * Model. SPSS will do the likelihood ratio chi-square test for you. Compute CHEducx = Church * EducX. LOGISTIC REGRESSION VAR = HAPPYMAR / ENTER CHURCH FEMALE EDUCX/ Enter Cheducx.