Multiple Meta-Regression SPSS Macro Issues

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Meta-Regression SPSS Macro Issues

BillT
I'm conducting a meta-analysis and I've come across an issue with having two covariate predictors (study quality and attrition%) that require both to be entered into a multiple meta-regression and Comprehensive Meta-Analysis version 2 only allows for one covariate to be entered and tested separately. There is a SPSS macro (MetaReg.sps) found at http://mason.gmu.edu/~dwilsonb/ma.html that I've read can analyze more than one covariate, but when I run the macro I keep getting error messages. In my SPSS file I have created the following variables ES for effect size, W for the inverse variance weight, and IVS for one independent variable (I'll add the other IV covariate once I can get this macro working). I would appreciate it if someone can tell me what I am doing wrong or what changes I have to make to run the Macro. Below is the error message I get when I run the full macro. Thanks for your time.

*--------------------------------------------------------------
*' SPSS/Win 6.1 or Higher Macro -- Written by David B. Wilson
*' Meta-Analysis Modified Weighted Multiple Regression for
*' any type of effect size
*' To use, initialize macro with the include statement:
*' INCLUDE "[drive][path]METAREG.SPS" .
*' Syntax for macro:
*' METAREG ES=varname /W=varname /IVS=varlist
*'   /MODEL=option /PRINT=option .
*' Where ES is the effect size variable, W is the inverse
*' variance weight, IVS is the list of independent variables
*' and MODEL is either FE for a fixed effects model, MM for
*' a random effects model estimated via the method of moments,
*' and ML is a random effects model estimated via iterative
*' maximum likelihood.  If /MODEL is omitted, FE is the
*' default.  The /PRINT subcommand has the option EXP and
*' if specified will print the exponent of the B coefficient
*' (the odds-ratio) rather than beta.  If /PRINT is omitted,
*' beta is printed.
*' Example:
*'
*' metareg es = effct /w = invweght /ivs = txvar1 txvar2
*'    /model = fe .
*'
*' Version 2005.05.23
*'
*--------------------------------------------------------------
preserve
set printback=off
define metareg (es=!charend('/')
 /w=!charend('/') /ivs=!charend('/')
 /model = !default('FE') !charend('/')
 /print = !default('RAW') !charend('/'))
preserve
set printback=off mprint off

*--------------------------------------------------------------
* Enter matrix mode
*--------------------------------------------------------------
matrix

*--------------------------------------------------------------
*  Get data from active file
*--------------------------------------------------------------
get data /file * /variables = !es !w !ivs /missing omit

*--------------------------------------------------------------
*  Create vectors and matrices
*--------------------------------------------------------------.
compute es = data(1:nrow(data),1) .

>Error # 4032 in column 14.  Text: data
>The CTIME, DATE, TIME and XDATE functions, as well as CDF, IDF, NCDF, NPDF,
>PDF, and RV functions require a function modifier.  None was found.
>Execution of this command stops.
compute w = data(1:nrow(data),2) .

>Error # 4032 in column 13.  Text: data
>The CTIME, DATE, TIME and XDATE functions, as well as CDF, IDF, NCDF, NPDF,
>PDF, and RV functions require a function modifier.  None was found.
>Execution of this command stops.
compute x = make(nrow(data),ncol(data)-1,1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
do if ncol(data)>3 .

>Error # 4023 in column 7.  Text: ncol
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute x(1:nrow(data),2:(ncol(data)-1))=
                  data(1:nrow(data),3:(ncol(data))).

>Error # 4030 in column 11.  Text: x
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ else if ncol(data)=3 .

>Error # 4055.  Command name: else if
>The ELSE IF command does not follow an unclosed DO IF command.  Maybe the DO
>IF command was not recognized because of an error.  Use the level-of-control
>shown to the left of the SPSS Statistics commands to determine the range of
>LOOPs and DO IFs.
>Execution of this command stops.
+ compute x(1:nrow(data),2)=data(1:nrow(data),3).

>Error # 4030 in column 11.  Text: x
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
end if .

>Error # 4070.  Command name: end if
>The command does not follow an unclosed DO IF command.  Maybe the DO IF
>command was not recognized because of an error.  Use the level-of-control
>shown to the left of the SPSS Statistics commands to determine the range of
>LOOPs and DO IFs.
>Execution of this command stops.
compute p = make(1,ncol(x),1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute k = make(1,nrow(x),1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute v = (w&**-1) .

>Error # 4007 in column 15.  Text: &**
>The expression is incomplete.  Check for missing operands, invalid operators,
>unmatched parentheses or excessive string length.
>Execution of this command stops.
release data .

>Error # 1.  Command name: release
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Recompute weights for random effects models
*  Method of moments
*--------------------------------------------------------------.
!IF (!model !eq 'MM'|!model !eq 'mm'|!model !eq 'ML'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
   !model !eq 'ml'|!model !eq 'REML'|!model !eq 'reml') !THEN .
compute xwx = T(x&*(w*p))*x .

>Error # 4023 in column 15.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute B   = inv(xwx)*T(x&*(w*p))*es .

>Error # 4023 in column 15.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qe  = csum(es&*w&*es) - T(B)*xwx*B .

>Error # 4023 in column 15.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute c = (qe-(nrow(es)-ncol(x)))/
     csum(w - rsum((x&*(w*p)*inv(T(x&*(w*p))*x))&*x&*(w*p))) .

>Error # 4285 in column 14.  Text: qe
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
do if c<0 .
+ compute c = 0 .
end if .
compute w   = 1/(v+c) .

>Error # 4285 in column 18.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'ML' | !model !eq 'ml'|!model !eq 'REML'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
   !model !eq 'reml') !THEN .
compute c2 = c .
loop l=1 to 200 .
.compute loops = l .
.compute c = c2 .
.compute w = 1/(v + c) .

>Error # 4285 in column 17.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute xw = x&*(w*p) .

>Error # 4285 in column 15.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute xwx = T(xw)*x .

>Error # 4023 in column 16.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.compute B = inv(xwx)*T(xw)*es .

>Error # 4023 in column 14.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.compute r = es -x*B .

>Error # 4285 in column 18.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute c2 = csum(w&**2&*(r&**2 - v))/csum(w&**2) .

>Error # 4023 in column 15.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.do if c2<0 .
. compute c2 = 0 .
.end if .
end loop if abs(c2 - c)<.0000000001 .
compute c = c2 .
compute w = 1/(v + c) .

>Error # 4285 in column 16.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute se_c = sqrt(2/csum(w&**2)) .

>Error # 4023 in column 23.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'REML' | !model !eq 'reml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
compute c = c2*(nrow(es)*inv(nrow(es)-ncol(x))) .

>Error # 4023 in column 17.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute w = 1/(v + c) .

>Error # 4285 in column 16.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute se_c = sqrt(2/csum(w&**2)) .

>Error # 4023 in column 23.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute Final Model
*--------------------------------------------------------------.
compute xw = x&*(w*p) .

>Error # 4285 in column 14.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute xwx = T(xw)*x .

>Error # 4023 in column 15.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute B = inv(xwx)*T(xw)*es .

>Error # 4023 in column 13.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute Homogeneity Q for each B, for the fit of the
*  regression and for the residuals
*--------------------------------------------------------------.
compute meanes = csum(es&*w)/csum(w) .

>Error # 4023 in column 18.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute q =  csum((meanes - es)&*(meanes - es)&*w) .

>Error # 4023 in column 14.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qe = csum(es&*w&*es) - T(B)*xwx*B .

>Error # 4023 in column 14.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qr = q - qe .

>Error # 4285 in column 14.  Text: q
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute dfe = nrow(es)-ncol(x) .

>Error # 4023 in column 15.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute dfr = ncol(x)-1 .

>Error # 4023 in column 15.  Text: ncol
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute dft = nrow(es)-1 .

>Error # 4023 in column 15.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute pe = 1 - chicdf(qe,dfe) .

>Error # 4023 in column 18.  Text: chicdf
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute pr = 1 - chicdf(qr,dfr) .

>Error # 4023 in column 18.  Text: chicdf
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute se = sqrt(diag(inv(xwx))) .

>Error # 4023 in column 19.  Text: diag
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute zvalues = B&/se .

>Error # 4285 in column 19.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute pvalues = (1 - cdfnorm(abs(zvalues)))*2 .

>Error # 4285 in column 36.  Text: zvalues
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute lowerB = B - se*1.96 .

>Error # 4285 in column 18.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute upperB = B + se*1.96 .

>Error # 4285 in column 18.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute standardized coefficients (betas)
*--------------------------------------------------------------
compute d = x - T(T(csum(x&*(w*p)))*k)&/csum(w) .
compute sx = sqrt(diag(T(d&*(w*p))*d&/csum(w))) .

>Error # 4023 in column 19.  Text: diag
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute sy = sqrt(q/csum(w)) .

>Error # 4285 in column 19.  Text: q
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute beta = (B&*sx)&/sy .

>Error # 4285 in column 17.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute r2 = qr/(qr+qe) .

>Error # 4285 in column 14.  Text: qr
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IF (!print !eq 'EXP'|!print !eq 'exp'|!print !eq 'Exp') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
compute beta = exp(B) .

>Error # 4285 in column 20.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Create results matrices
*--------------------------------------------------------------.
compute homog = make(3,3,-999) .

>Error # 4023 in column 17.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute homog(1,1) = qr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(1,2) = dfr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(1,3) = pr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,1) = qe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,2) = dfe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,3) = pe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,1) = q .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,2) = dft .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,3) = 1 - chicdf(q,dft) .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

compute keep = make(ncol(x),7,-999) .

>Error # 4023 in column 16.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute keep(1:ncol(x),1) = B .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),2) = se .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),3) = lowerB .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),4) = upperB .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),5) = zvalues .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),6) = pvalues .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),7) = beta .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

compute descrpt = make(1,3,-999) .

>Error # 4023 in column 19.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute descrpt(1,1) = meanes .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute descrpt(1,2) = r2 .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute descrpt(1,3) = nrow(es) .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

*--------------------------------------------------------------
*  Print Results
*--------------------------------------------------------------.
print /title "Version 2005.05.23".

>Error # 4285 in column 8.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
print /title " *****  Inverse Variance Weighted Regression  *****" .

>Error # 4285 in column 8.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IF (!model !eq 'ML' | !model !eq 'ml'|!model !eq 'MM'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
    !model !eq 'mm' | !model !eq 'REML' | !model !eq 'reml') !THEN .
print  /title " *****  Random Intercept, Fixed Slopes Model  *****" .

>Error # 4285 in column 9.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!ELSE

>Error # 1.  Command name: !ELSE
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print  /title " *****  Fixed Effects Model via OLS  *****" .
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

print descrpt /title "------- Descriptives -------"
  /clabel "Mean ES" "R-Squared" "k"
  /format f12.4 .

>Error # 4700 in column 7.  Text: descrpt
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
print homog /title "------- Homogeneity Analysis -------"
  /clabel "Q" "df" "p"
  /rlabel "Model" "Residual" "Total"
  /format f12.4 .

>Error # 4700 in column 7.  Text: homog
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IF (!print !eq 'EXP'|!print !eq 'exp'|!print !eq 'Exp') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print keep /title "------- Regression Coefficients -------"
    /clabel "B"  "SE" "-95% CI" "+95% CI" "Z" "P" "EXP(B)"
    /rlabel "Constant" !ivs

>Warning # 210 in column 24.  Text: !ivs
>A macro symbol is invalid in this context.
>The symbol will be treated as an invalid special character.
    /format f8.4 .

>Error # 4700 in column 7.  Text: keep
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!ELSE

>Error # 1.  Command name: !ELSE
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print keep /title "------- Regression Coefficients -------"
    /clabel "B"  "SE" "-95% CI" "+95% CI" "Z" "P" "Beta"
    /rlabel "Constant" !ivs
    /format f8.4 .
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'MM'|!model !eq 'mm') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print c
  /title  "------- Method of Moments Random Effects Variance"+
  " Component ------- "
  /rlabel "v      ="
  /format f8.5 .

>Error # 4700 in column 7.  Text: c
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
!IF (!model !eq 'ML' | !model !eq 'ml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
+ compute mlc      = make(2,1,-999) .

>Error # 4023 in column 22.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute mlc(1,1) = c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ compute mlc(2,1) = se_c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ print mlc
   /title   "------- Maximum Likelihood Random Effects"+
   " Variance Component ------- "
   /rlabel "v      =" "se(v)  ="
   /format f8.5 .

>Error # 4700 in column 9.  Text: mlc
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
!IF (!model !eq 'REML' | !model !eq 'reml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
+ compute mlc      = make(2,1,-999) .

>Error # 4023 in column 22.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute mlc(1,1) = c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ compute mlc(2,1) = se_c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ print mlc
   /title   "------- Restricted Maximum Likelihood Random"+
   " Effects Variance Component ------- "
   /rlabel "v      =" "se(v)  ="
   /format f8.5 .

>Error # 4700 in column 9.  Text: mlc
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
* End matrix mode
*--------------------------------------------------------------
end matrix

*--------------------------------------------------------------
* Restore settings and exit
*--------------------------------------------------------------
restore
!enddefine
restore.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

Bruce Weaver
Administrator
I notice that the syntax in that macro definition has many commands that don't have command terminators.  One of these occurs right before your first error message--this one:

get data /file * /variables = !es !w !ivs /missing omit

Given that the error seems to be caused by failure to recognize "data", I'd try it with a command terminator added to that line, for starters.  (You might also try contacting the fellow who wrote the macro.)  ;-)

HTH.


BillT wrote
I'm conducting a meta-analysis and I've come across an issue with having two covariate predictors (study quality and attrition%) that require both to be entered into a multiple meta-regression and Comprehensive Meta-Analysis version 2 only allows for one covariate to be entered and tested separately. There is a SPSS macro (MetaReg.sps) found at http://mason.gmu.edu/~dwilsonb/ma.html that I've read can analyze more than one covariate, but when I run the macro I keep getting error messages. In my SPSS file I have created the following variables ES for effect size, W for the inverse variance weight, and IVS for one independent variable (I'll add the other IV covariate once I can get this macro working). I would appreciate it if someone can tell me what I am doing wrong or what changes I have to make to run the Macro. Below is the error message I get when I run the full macro. Thanks for your time.

*--------------------------------------------------------------
*' SPSS/Win 6.1 or Higher Macro -- Written by David B. Wilson
*' Meta-Analysis Modified Weighted Multiple Regression for
*' any type of effect size
*' To use, initialize macro with the include statement:
*' INCLUDE "[drive][path]METAREG.SPS" .
*' Syntax for macro:
*' METAREG ES=varname /W=varname /IVS=varlist
*'   /MODEL=option /PRINT=option .
*' Where ES is the effect size variable, W is the inverse
*' variance weight, IVS is the list of independent variables
*' and MODEL is either FE for a fixed effects model, MM for
*' a random effects model estimated via the method of moments,
*' and ML is a random effects model estimated via iterative
*' maximum likelihood.  If /MODEL is omitted, FE is the
*' default.  The /PRINT subcommand has the option EXP and
*' if specified will print the exponent of the B coefficient
*' (the odds-ratio) rather than beta.  If /PRINT is omitted,
*' beta is printed.
*' Example:
*'
*' metareg es = effct /w = invweght /ivs = txvar1 txvar2
*'    /model = fe .
*'
*' Version 2005.05.23
*'
*--------------------------------------------------------------
preserve
set printback=off
define metareg (es=!charend('/')
 /w=!charend('/') /ivs=!charend('/')
 /model = !default('FE') !charend('/')
 /print = !default('RAW') !charend('/'))
preserve
set printback=off mprint off

*--------------------------------------------------------------
* Enter matrix mode
*--------------------------------------------------------------
matrix

*--------------------------------------------------------------
*  Get data from active file
*--------------------------------------------------------------
get data /file * /variables = !es !w !ivs /missing omit

*--------------------------------------------------------------
*  Create vectors and matrices
*--------------------------------------------------------------.
compute es = data(1:nrow(data),1) .

>Error # 4032 in column 14.  Text: data
>The CTIME, DATE, TIME and XDATE functions, as well as CDF, IDF, NCDF, NPDF,
>PDF, and RV functions require a function modifier.  None was found.
>Execution of this command stops.
compute w = data(1:nrow(data),2) .

>Error # 4032 in column 13.  Text: data
>The CTIME, DATE, TIME and XDATE functions, as well as CDF, IDF, NCDF, NPDF,
>PDF, and RV functions require a function modifier.  None was found.
>Execution of this command stops.
compute x = make(nrow(data),ncol(data)-1,1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
do if ncol(data)>3 .

>Error # 4023 in column 7.  Text: ncol
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute x(1:nrow(data),2:(ncol(data)-1))=
                  data(1:nrow(data),3:(ncol(data))).

>Error # 4030 in column 11.  Text: x
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ else if ncol(data)=3 .

>Error # 4055.  Command name: else if
>The ELSE IF command does not follow an unclosed DO IF command.  Maybe the DO
>IF command was not recognized because of an error.  Use the level-of-control
>shown to the left of the SPSS Statistics commands to determine the range of
>LOOPs and DO IFs.
>Execution of this command stops.
+ compute x(1:nrow(data),2)=data(1:nrow(data),3).

>Error # 4030 in column 11.  Text: x
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
end if .

>Error # 4070.  Command name: end if
>The command does not follow an unclosed DO IF command.  Maybe the DO IF
>command was not recognized because of an error.  Use the level-of-control
>shown to the left of the SPSS Statistics commands to determine the range of
>LOOPs and DO IFs.
>Execution of this command stops.
compute p = make(1,ncol(x),1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute k = make(1,nrow(x),1) .

>Error # 4023 in column 13.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute v = (w&**-1) .

>Error # 4007 in column 15.  Text: &**
>The expression is incomplete.  Check for missing operands, invalid operators,
>unmatched parentheses or excessive string length.
>Execution of this command stops.
release data .

>Error # 1.  Command name: release
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Recompute weights for random effects models
*  Method of moments
*--------------------------------------------------------------.
!IF (!model !eq 'MM'|!model !eq 'mm'|!model !eq 'ML'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
   !model !eq 'ml'|!model !eq 'REML'|!model !eq 'reml') !THEN .
compute xwx = T(x&*(w*p))*x .

>Error # 4023 in column 15.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute B   = inv(xwx)*T(x&*(w*p))*es .

>Error # 4023 in column 15.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qe  = csum(es&*w&*es) - T(B)*xwx*B .

>Error # 4023 in column 15.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute c = (qe-(nrow(es)-ncol(x)))/
     csum(w - rsum((x&*(w*p)*inv(T(x&*(w*p))*x))&*x&*(w*p))) .

>Error # 4285 in column 14.  Text: qe
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
do if c<0 .
+ compute c = 0 .
end if .
compute w   = 1/(v+c) .

>Error # 4285 in column 18.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'ML' | !model !eq 'ml'|!model !eq 'REML'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
   !model !eq 'reml') !THEN .
compute c2 = c .
loop l=1 to 200 .
.compute loops = l .
.compute c = c2 .
.compute w = 1/(v + c) .

>Error # 4285 in column 17.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute xw = x&*(w*p) .

>Error # 4285 in column 15.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute xwx = T(xw)*x .

>Error # 4023 in column 16.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.compute B = inv(xwx)*T(xw)*es .

>Error # 4023 in column 14.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.compute r = es -x*B .

>Error # 4285 in column 18.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
.compute c2 = csum(w&**2&*(r&**2 - v))/csum(w&**2) .

>Error # 4023 in column 15.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
.do if c2<0 .
. compute c2 = 0 .
.end if .
end loop if abs(c2 - c)<.0000000001 .
compute c = c2 .
compute w = 1/(v + c) .

>Error # 4285 in column 16.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute se_c = sqrt(2/csum(w&**2)) .

>Error # 4023 in column 23.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'REML' | !model !eq 'reml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
compute c = c2*(nrow(es)*inv(nrow(es)-ncol(x))) .

>Error # 4023 in column 17.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute w = 1/(v + c) .

>Error # 4285 in column 16.  Text: v
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute se_c = sqrt(2/csum(w&**2)) .

>Error # 4023 in column 23.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute Final Model
*--------------------------------------------------------------.
compute xw = x&*(w*p) .

>Error # 4285 in column 14.  Text: x
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute xwx = T(xw)*x .

>Error # 4023 in column 15.  Text: T
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute B = inv(xwx)*T(xw)*es .

>Error # 4023 in column 13.  Text: inv
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute Homogeneity Q for each B, for the fit of the
*  regression and for the residuals
*--------------------------------------------------------------.
compute meanes = csum(es&*w)/csum(w) .

>Error # 4023 in column 18.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute q =  csum((meanes - es)&*(meanes - es)&*w) .

>Error # 4023 in column 14.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qe = csum(es&*w&*es) - T(B)*xwx*B .

>Error # 4023 in column 14.  Text: csum
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute qr = q - qe .

>Error # 4285 in column 14.  Text: q
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute dfe = nrow(es)-ncol(x) .

>Error # 4023 in column 15.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute dfr = ncol(x)-1 .

>Error # 4023 in column 15.  Text: ncol
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute dft = nrow(es)-1 .

>Error # 4023 in column 15.  Text: nrow
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute pe = 1 - chicdf(qe,dfe) .

>Error # 4023 in column 18.  Text: chicdf
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute pr = 1 - chicdf(qr,dfr) .

>Error # 4023 in column 18.  Text: chicdf
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute se = sqrt(diag(inv(xwx))) .

>Error # 4023 in column 19.  Text: diag
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute zvalues = B&/se .

>Error # 4285 in column 19.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute pvalues = (1 - cdfnorm(abs(zvalues)))*2 .

>Error # 4285 in column 36.  Text: zvalues
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute lowerB = B - se*1.96 .

>Error # 4285 in column 18.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute upperB = B + se*1.96 .

>Error # 4285 in column 18.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Compute standardized coefficients (betas)
*--------------------------------------------------------------
compute d = x - T(T(csum(x&*(w*p)))*k)&/csum(w) .
compute sx = sqrt(diag(T(d&*(w*p))*d&/csum(w))) .

>Error # 4023 in column 19.  Text: diag
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute sy = sqrt(q/csum(w)) .

>Error # 4285 in column 19.  Text: q
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute beta = (B&*sx)&/sy .

>Error # 4285 in column 17.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
compute r2 = qr/(qr+qe) .

>Error # 4285 in column 14.  Text: qr
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IF (!print !eq 'EXP'|!print !eq 'exp'|!print !eq 'Exp') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
compute beta = exp(B) .

>Error # 4285 in column 20.  Text: B
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
*  Create results matrices
*--------------------------------------------------------------.
compute homog = make(3,3,-999) .

>Error # 4023 in column 17.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute homog(1,1) = qr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(1,2) = dfr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(1,3) = pr .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,1) = qe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,2) = dfe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(2,3) = pe .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,1) = q .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,2) = dft .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute homog(3,3) = 1 - chicdf(q,dft) .

>Error # 4030 in column 9.  Text: homog
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

compute keep = make(ncol(x),7,-999) .

>Error # 4023 in column 16.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute keep(1:ncol(x),1) = B .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),2) = se .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),3) = lowerB .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),4) = upperB .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),5) = zvalues .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),6) = pvalues .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute keep(1:ncol(x),7) = beta .

>Error # 4030 in column 9.  Text: keep
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

compute descrpt = make(1,3,-999) .

>Error # 4023 in column 19.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
compute descrpt(1,1) = meanes .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute descrpt(1,2) = r2 .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
compute descrpt(1,3) = nrow(es) .

>Error # 4030 in column 9.  Text: descrpt
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.

*--------------------------------------------------------------
*  Print Results
*--------------------------------------------------------------.
print /title "Version 2005.05.23".

>Error # 4285 in column 8.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
print /title " *****  Inverse Variance Weighted Regression  *****" .

>Error # 4285 in column 8.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!IF (!model !eq 'ML' | !model !eq 'ml'|!model !eq 'MM'|

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
    !model !eq 'mm' | !model !eq 'REML' | !model !eq 'reml') !THEN .
print  /title " *****  Random Intercept, Fixed Slopes Model  *****" .

>Error # 4285 in column 9.  Text: title
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
!ELSE

>Error # 1.  Command name: !ELSE
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print  /title " *****  Fixed Effects Model via OLS  *****" .
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

print descrpt /title "------- Descriptives -------"
  /clabel "Mean ES" "R-Squared" "k"
  /format f12.4 .

>Error # 4700 in column 7.  Text: descrpt
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
print homog /title "------- Homogeneity Analysis -------"
  /clabel "Q" "df" "p"
  /rlabel "Model" "Residual" "Total"
  /format f12.4 .

>Error # 4700 in column 7.  Text: homog
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IF (!print !eq 'EXP'|!print !eq 'exp'|!print !eq 'Exp') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print keep /title "------- Regression Coefficients -------"
    /clabel "B"  "SE" "-95% CI" "+95% CI" "Z" "P" "EXP(B)"
    /rlabel "Constant" !ivs

>Warning # 210 in column 24.  Text: !ivs
>A macro symbol is invalid in this context.
>The symbol will be treated as an invalid special character.
    /format f8.4 .

>Error # 4700 in column 7.  Text: keep
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!ELSE

>Error # 1.  Command name: !ELSE
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print keep /title "------- Regression Coefficients -------"
    /clabel "B"  "SE" "-95% CI" "+95% CI" "Z" "P" "Beta"
    /rlabel "Constant" !ivs
    /format f8.4 .
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

!IF (!model !eq 'MM'|!model !eq 'mm') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
print c
  /title  "------- Method of Moments Random Effects Variance"+
  " Component ------- "
  /rlabel "v      ="
  /format f8.5 .

>Error # 4700 in column 7.  Text: c
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
!IF (!model !eq 'ML' | !model !eq 'ml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
+ compute mlc      = make(2,1,-999) .

>Error # 4023 in column 22.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute mlc(1,1) = c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ compute mlc(2,1) = se_c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ print mlc
   /title   "------- Maximum Likelihood Random Effects"+
   " Variance Component ------- "
   /rlabel "v      =" "se(v)  ="
   /format f8.5 .

>Error # 4700 in column 9.  Text: mlc
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
!IF (!model !eq 'REML' | !model !eq 'reml') !THEN .

>Error # 1.  Command name: !IF
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.
+ compute mlc      = make(2,1,-999) .

>Error # 4023 in column 22.  Text: make
>An expression contains a string of characters followed by a left parenthesis,
>indicating that the string of characters is a function or vector name, but the
>characters do not match any existing function or vector.  Check the spelling.
>Execution of this command stops.
+ compute mlc(1,1) = c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ compute mlc(2,1) = se_c .

>Error # 4030 in column 11.  Text: mlc
>The operand appearing on the left side of the assignment operator (equals
>sign) is not a known vector name or function name.
>Execution of this command stops.
+ print mlc
   /title   "------- Restricted Maximum Likelihood Random"+
   " Effects Variance Component ------- "
   /rlabel "v      =" "se(v)  ="
   /format f8.5 .

>Error # 4700 in column 9.  Text: mlc
>An output command contains an unrecognized keyword.  The recognized keywords
>are OUTFILE, RECORDS, TABLE, and NOTABLE.
>Execution of this command stops.
!IFEND .

>Error # 1.  Command name: !IFEND
>The first word in the line is not recognized as an SPSS Statistics command.
>Execution of this command stops.

*--------------------------------------------------------------
* End matrix mode
*--------------------------------------------------------------
end matrix

*--------------------------------------------------------------
* Restore settings and exit
*--------------------------------------------------------------
restore
!enddefine
restore.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

David Marso
Administrator
In reply to this post by BillT
At the top of that macro:
"
*' To use, initialize macro with the include statement:
*' INCLUDE "[drive][path]METAREG.SPS" .
*' Syntax for macro:"

Alternatively consult the FM for INSERT and see the options available!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

BillT
Ok, I will try that now, thanks
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

BillT
Sorry, not familiar with what a command terminator is. Not new to SPSS, but new to editing syntax. I also emailed the writer of this macro but given his position of what he does now I doubt he has the time to help me.
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

Bruce Weaver
Administrator
A period (or full stop) is the command terminator--although a blank line is supposed to function as a command terminator too according to the help files (see the link below).

http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Fsyntax_rules.htm



BillT wrote
Sorry, not familiar with what a command terminator is. Not new to SPSS, but new to editing syntax. I also emailed the writer of this macro but given his position of what he does now I doubt he has the time to help me.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

David Marso
Administrator
This post was updated on .
At the risk of sounding like an Eh-Whole, or a Mr. Kranky-Kilt (TM my sigoth)
-------------------------------------------------------------------------------------------
I urge that  *ALL* writers of MACROs intended for public consumption

1. PLEASE use command terminators.
2. PLEASE use proper indentation.
 
Why?

1. SO your macro will run any way a user decides to use it:
   a. (open> select all > run) :MacroCommand.
   b. INSERT :MacroCommand.
   c. INCLUDE: MacroCommand.
   d. Most importantly AFAIAC So contributors to this list aren't doing your TekSport!
   e. FWIW: So you don't receive email from people that haven't read the docs. -added in edit-

I know the 'rules' are documented in the readme, but do you seriously think people do the RTFM thing?
------------------------------------------------------------------------------------------------------------------
Maybe this should be a new thread?  
If so, Bruce you know how/what to do ;-) And you have the Power!
------------------------------------------------------------------------------------
Bruce Weaver wrote
A period (or full stop) is the command terminator--although a blank line is supposed to function as a command terminator too according to the help files (see the link below).

http://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Fsyntax_rules.htm



BillT wrote
Sorry, not familiar with what a command terminator is. Not new to SPSS, but new to editing syntax. I also emailed the writer of this macro but given his position of what he does now I doubt he has the time to help me.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

BillT
MetaReg.spsmetareg.sav

I added termination commands and tried my best to clean up the data and the macro still doesn't work. I attached the macro and my spss data file that I need to run the meta-regression on which includes effect size data in column 1 (es), inverse variance weight data in column 2 (w), drop out % in column 3 (ivs), and study quality data in column 4 (ivs2). Maybe you can play around with the Macro and see if it'll run the meta-regression I need. When it works it is supposed to look like this http://mason.gmu.edu/~dwilsonb/scrshots/screenshot5.html

I know there must be an easy fix/adjustment to this macro because researchers report using it a lot in meta-analysis publications for their meta-regression analyses. Any help will be much appreciated!!!
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

David Marso
Administrator
INCLUDE "C:\Users\david2\Desktop\Consulting\MetaReg.sps".
GET FILE "C:\Users\david2\Desktop\Consulting\MetaReg.sav".
MetaReg es=es / w=w /ivs=ivs ivs2.

 

Results:

Run MATRIX procedure:
 
Version 2005.05.23
 
 *****  Inverse Variance Weighted Regression  *****
 
 *****  Fixed Effects Model via OLS  *****
 
------- Descriptives -------
      Mean ES     R-Square            k
       -.6134        .1647      54.0000
 
------- Homogeneity Analysis -------
                    Q           df            p
 Model          9.5412       2.0000        .0085
Residual      48.3793      51.0000        .5784
Total         57.9205      53.0000        .2987
 
------- Regression Coefficients -------
                B       SE  -95% CI  +95% CI        Z        P     Beta
 Constant  -1.4721    .3895  -2.2355   -.7086  -3.7793    .0002    .0000
ivs         .0125    .0050    .0028    .0223   2.5298    .0114    .3336
ivs2        .0176    .0114   -.0047    .0399   1.5485    .1215    .2042
 
------ END MATRIX -----
BillT wrote
MetaReg.spsmetareg.sav

I added termination commands and tried my best to clean up the data and the macro still doesn't work. I attached the macro and my spss data file that I need to run the meta-regression on which includes effect size data in column 1 (es), inverse variance weight data in column 2 (w), drop out % in column 3 (ivs), and study quality data in column 4 (ivs2). Maybe you can play around with the Macro and see if it'll run the meta-regression I need. When it works it is supposed to look like this http://mason.gmu.edu/~dwilsonb/scrshots/screenshot5.html

I know there must be an easy fix/adjustment to this macro because researchers report using it a lot in meta-analysis publications for their meta-regression analyses. Any help will be much appreciated!!!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

BillT
Ok I finally got it working!! Thanks everyone for your help and patients with me =D
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

David Marso
Administrator
Take heed of the /MODEL specification as defined in the header of the macro ;-)
BillT wrote
Ok I finally got it working!! Thanks everyone for your help and patients with me =D
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Meta-Regression SPSS Macro Issues

David Marso
Administrator
In reply to this post by BillT
Full circle for Closure:
http://spssx-discussion.1045642.n5.nabble.com/SPSS-MACRO-Robust-variance-estimation-in-meta-regression-with-dependent-effect-size-estimates-tt5722785.html
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"