how to automatically repeat the same analysis

css

New Member
#1
Hi everyone,
I am conducting a study and I have to perform over 200 multiple regression analyses with the same predictors (2, one dichotomic and one continuous) but with different dependent variables. Of course, this might just be done manually, but it might be too time-consuming and prone to error. Therefore, I am wondering whether if this could be automatically done with some syntax.

Thanks in advance for any answer you could probably provide.
 
#2
Hi CSS,

You can try the following: http://www.statskingdom.com/411list_linear_regression.html
You should copy the data from excel (or any excel like with tab and NL delimiters)
It will run separately (automatically) for each Y column, please ensure to define the correct number of Y columns...
I tried it with 18 Y columns and it seems to work. please let me know if it works for you.
 
Last edited:

css

New Member
#3
Hi Obh,

Thanks a lot for your fast answer and for providing this link. It does not entirely respond to I need now but I am sure it will be useful in the future.

I have checked this resource and it seems to work properly (at least with 25 dependent variables, I have only tried with a subset of my data). It is a pity that the output of this nice resource excludes some data crucial to me, as I would like to obtain beta weights, the partial and semi-partial correlations of the predictors and the residual values. Any idea about how to do that?

Again, many thanks.
 
#4
Hi CSS,

What is the problem with the current page?
What data does it miss?
If you clean the "cached images and files" you will see also the ANOVA table.
 
Last edited:

css

New Member
#5
Hi obh,
Thanks for your new response.
I would like to obtain the residual values but I did not see how to do that. I would also like to obtain standardized regression coefficients... Perhaps I am doing something wrong but I do not see any option named "cached images and files" but I obtain the ANOVA table without pressing any option
 
#6
Coefficients are there (coeff in the second table) .

Generally, you need to check in "Residuals Table" or/and " ANOVA Table" or/and... to get more data.
I assume it should be okay now.

If still not okay, can you please show an example of how you like it to be? (includes the residuals) and I will show you how to do ???

"cached images and files" is cleaning the browser cache (at least in google chrome)
 
Last edited:

css

New Member
#7
Hi Obh,
First of all, let me thank you for your patience and continued help.
I now got the residuals table I was looking for. I have also obtained the regression coefficients, although only the unstandardized ones. It would be great to also obtain the standardized ones to have a first grasp of the relative contribution of each predictor. However, I guess I can get similar information by calculating the semi-partial correlations of each predictor (by correlating predictor 1 with the residuals of the regression dependent variable-predictor 2, and viceversa).
In summary, many thanks for your help and patience :)
 
#8
Hi Css,

I assume that you want to standardized the data before performing the regression.? It should not be a problem.
Do you need both standardize and not standardized?

I will check tomorrow. Please check my answer tomorrow :)
 

css

New Member
#9
Hi obh,

thanks a lot.
I am not sure if I explained myself right. So, I attach an snapshot from SPSS output and indicate there what I meant about standardized coefficients. Seems I am using SPSS in Spanish, I added some labels by hand.

One more time, thanks for all your help and patience. :)
 

Attachments

#12
Hi, CSS,
You can write a macro in SPSS syntax and use it. Another way is to copy to Excel names of your variables: 1 column for names of dependent variable, 2 column for the 1st predictor name (the same for each name of dependent var), 3 column for the 2nd predictor name (also the same for each line), then in 4th column concatenate parts of your procedure commands with actual vars names as links to corresponding cells. Then expand this concatentation formula to all strings. You will obtain necessary syntax for all predictors, you just will need to dispose line breaks - you can do it in Word for example - using Replace. The third way is combination of both previous.
 
#13
Hi obh, now it looks exactly as I wanted. Thank you very much for providing this page and for introducing the amends that I suggested. It will be very helpful for my current project. Again, thank you very much.

ask.biostat, I also appreciate your comments. However, I am not familiar enough with SPSS as to write such a macro (that's why I looked for help on this forum). Nevertheless, I appreciate you took the time to help me out.
 
#14
CSS, I can help you, without macros writing. Then you conduct any analysis, you choose some options and click OK. There is also button "Paste" in an analysis window. If you click on it instead OK, you will see the syntax which provide the analysis. You can modify this syntax (changing var names, add/remove options and other) and run. May you copy syntax of your analysis and past here?
 
#15
Hi Css,

I glad I could help you :)

Of course, the page is not a substituted to SPSS or R ...but it can do the job in your case and many other cases, hopefully easily...
Actually, I didn't notice it was an SPSS question ...

I tested it successfully in google chrome with 3 X columns and 50 Y columns of 145 values, 10 digits each.
When I paste 100 Y columns chrome froze. I will check if something can be done in chrome.
surprisingly it works successfully with 200 Y columns on Firefox.

What browser do you use?
 
#17
Hi obh,
I am using chrome and what I did was break down my analysis to batches of 50 dependent variables at the time. It worked nicely and it repeating the process four times was 50 times better than having to eat 200 times ;)

Of course, this kind of analyses should be handled with powerful and flexible statistical packages as R. Unfortunately, I am getting old to learn new programming skills (or at least, never have the time to interrupt my research and devote my time to learn this), so I keep working with less powerful tools. However, this is less problematic thanks to forums like this one (and to kind contributors like you or ask.biostat!)