Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I am running a series of regressions to eliminate the effects of IQ, language ability and age from my variables (task performance). To do this, the variable is entered as the dependent variable (e.g. EFT in syntax below) in a regression with IQ, language ability and age as predictor variables, selecting for control group only (GROUP1 EQ 2 is the control group). This regression equation is then applied to the other groups (GROUP1 = 0 & 1) and the residuals are collected.

The main problem I am having is converting the SPSS syntax below into Stata command (as I am relatively new to Stata). I need to use Stata to run the regression as my data are from related individuals and so I need to use the cluster command which isn't available in SPSS.

REGRESSION 
/SELECT=GROUP1 EQ 2 
/MISSING LISTWISE 
/STATISTICS COEFF OUTS R ANOVA 
/CRITERIA=PIN(.05) POUT(.10)
/NOORIGIN 
/DEPENDENT EFT
/METHOD=ENTER AGE IQ LANG 
/SAVE RESID (rEFT).
share|improve this question
(+1) Although software-specific questions usually belong elsewhere, we might be the best possible place for stats/data analysis questions about how two (or more) stats programs compare or interact. I suggest refraining from voting to close. – whuber Oct 3 '12 at 13:46

2 Answers

up vote 2 down vote accepted

It's not clear to me why you want to do this, but anyway... This is a tentative based on what I've understood from your post.

regress eft age iq lang if group1 == 2, vce(cluster clustvar)
predict resid1 if inlist(group1, 0, 1), resid

Where clustvar is your cluster variable

(Please note that using vce(cluster clustvar) or not, won't change the residuals calculated with the second line of code, but of course it changes the standard errors of the linear regression).

share|improve this answer
(+1) andrea is right, cluster correction only applies to the standard errors. It seems to me, although zombie14600 did not really state that, that SPSS syntax above asks for a stepwise regression (argh... this is a terrible method), so I edited the suggested code. – StasK Oct 3 '12 at 14:04
Yes, you're probably right @StasK (but as you say, it's a terrible method). Thanks for pointing that out. On a different note, is it only me who find it awkward to specify \NOORIGIN if you do want the intercept and \ORIGIN if you do not want the intercept? Probably it's just because I'm used to specify nocons (Stata) or noint (SAS), but it feels odd to me. Sorry if I've gone off topic. – andrea Oct 3 '12 at 14:13
3  
@StasK, the regression syntax for SPSS does not ask for stepwise regression. It is an unfortunate side effect of code produced from menu's, it always includes the CRITERIA statement, even if all variables are included in the equation. The relevant portion of the SPSS code is the /METHOD=ENTER portion, it would say METHOD = BACKWARD or something like that for the model selection techniques. I am going to roll back, andrea's solution was correct previously. – Andy W Oct 3 '12 at 14:21
Also I agree to intercept statement is a bit strange to view. Again it is a by-product of over-verbose code produced when using the GUI menu's, the defaults for both are logical when the substatements in SPSS are entirely excluded. – Andy W Oct 3 '12 at 14:26
Damn the interface. Thanks for editing it back. – StasK Oct 5 '12 at 2:07

I don't know what you mean by saying cluster is not available in SPSS. Perhaps you need the MIXED procedure or one of several others that might apply here.

share|improve this answer
Care to provide an example? Do any of the newer bootstrapping commands although to bootstrap given a categorical variable? – Andy W Oct 4 '12 at 15:59
Bootstrapping is factored out from the command. It should not care what the variables are. – JKP Oct 9 '12 at 3:16
Well, I'm not quite sure what I originally meant to say in that garbled prose, but I believe where I was going is that, for clustered data, in SPSS can you stratify the bootstrap estimates by the cluster. That is, the bootstrap sub-sample typically re-samples based on entire clusters, not individual cases within clusters (at least that is how Stata does it, which is what the OP is originally asking about). – Andy W Oct 9 '12 at 12:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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