Multiple regression: calculating shared variance with 3 or more variables.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Multiple regression: calculating shared variance with 3 or more variables.

Juris Breidaks
set err=off.
define !path() "C:\My Documents\SPSS_matrix" !end.
define !wbb()         "\Work\"                  !end.
define !in_file()               aggregates3.sav                 !end.
define !out_file()      out.sav                 !end.
define !x()                     resp,resp0                      !end.
define !y()                     total                           !end.
define !k()                     klase                           !end.
define !p()                     !eva(!path)                     !end.
define !f()                     !quo(!eva(!in_file))    !end.
define !b()                     !quo(!eva(!out_file))   !end.
set err=on.


include file=!pathq+"\Regresion.sps".

This file is  Regresion.sps

* this function is finding the regression coefficients with a matrix
procedure in SPSS
* the coefficients are saved in the file specified in the "!out_file()"
macro
* the input variables needed are : x (matrix), y (vector), k (vector for
grouping)
* WARNING : systematic use of the generalized inverse function "ginv"


get file=!pathq+!wbb+!f.
matrix.
get x
 /variables=!x /missing=accept
 /sysmis=0.
get y
 /variables=!y /missing=accept
 /sysmis=0.
get k
 /variables=!k /missing=accept
 /sysmis=0.

comp length=nrow(x).
comp i=k(length).
comp j=length/i.
comp coeffs= make(i,ncol(x),0)

loop n = 1 to i.
+ comp num=0.
+ comp denom=0.
+ loop m = 1 to j.
+  comp num=num+t(x((n-1)*j+m,:))*y((n-1)*j+m,:).
+  comp denom=denom+t(x((n-1)*j+m,:))*x((n-1)*j+m,:).
+ end loop.
+ comp coeffs(n,:)=t(ginv(denom)*num).
end loop.

print coeffs.

save {coeffs}
 /outfile=!pathq+!wbb+!b /variables=coeffs.

end matrix.

get file=!pathq+!wbb+!b.

----- Forwarded by Juris Breidaks/CSB/LV on 28.01.2009 09:27 -----

Karen Wood <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
28.01.2009 00:10
Please respond to
Karen Wood <[hidden email]>


To
[hidden email]
cc

Subject
Multiple regression: calculating shared variance with 3 or more
variables.






Hi

I am using multiple regression to determine predictors of academic
achievement (ENTER) . To judge the  importance of each predictor
variable I have used part (unique) correlations. However, the
variance shared with other independent variables in predicting ENTER
scores is also important. Is there a  way of calculating variance
shared between three or more predictor variables  using SPSS
(syntax?); or should I just leave this to SEM?

Karen

PS: "Thank you"

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD