Docsity

SPSS Mixed Linear Models Syntax for Analyzing Mixed Data, Study notes of Psychology

Toggle sidebar
bg1
SPSS Mixed Linear Models 1
/*******************************************************************************
************************ SPSS Mixed Model Syntax *******************************
*******************************************************************************/
MIXED
*** Outcome variable ***
DV
*** Categorical fixed effects go after BY ***
BY catvar1 catvar2
*** Continuous (covariate) fixed effects go after WITH ***
WITH time contvar
*** Request specific output ***
/PRINT =
*** Case processing summary: factor values, repeated measures variables,
repeated measure subjects, random effects subjects & frequencies ***
CPS
*** Descriptive Statistics: sample sizes, means, SD of DV & covariates
for each distinct combination of these factors ***
DESCRIPTIVES
*** Iteration History (1=print every iteration) ***
HISTORY(1)
*** Solution (estimates) for fixed and random effects ***
SOLUTION
*** Tests for covariance parameters (asymptotic SE's & Wald tests) ***
TESTCOV
*** Estimated covariance matrix of random effects and residuals ***
G R
*** SAVE Subcommand - Saves casewise statistics to working file ***
/SAVE =
*** Fixed Predicted Values, their SE’s, and Satterthwaite DF
Regression means without random effects ***
FIXPRED SEFIXP DFFIXP
*** Predicted Values, their SE’s, and Satterthwaite DF
Model fitted value (includes random effects) ***
PRED SEPRED DFPRED
*** Residuals - data value-predicted value ***
RESID
*** Estimation Criteria & subcommands (defaults) – usually DON’T CHANGE THESE ***
/CRITERIA =
*** Confidence interval level of 95% (0-100%) ***
CIN(95)
*** Maximum # Iterations, Maximum Half-Stepping (positive integer) ***
MXITER(100) MXSTEP(5)
*** Use Fisher scoring up to iteration (positive integer) ***
SCORING(1)
*** Tolerance value in checking singularity (positive value) ***
SINGULAR(0.000000000001)
*** Convergence Criteria (non-negative value, type) -
Hessian, Log-likelihood, Parameter Estimates ***
HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE)
*** Method of Estimation (REML, ML) ***
/METHOD = REML
*** Fixed Effects ***
*** Intercept included by default, or must be specified first ***
*** Can include interactions between different variables with asterisk ***
*** Cannot include squared terms for categorical variables using asterisk ***
/FIXED = time catvar1 catvar2 contvar time*catvar1 time*contvar |
pf2

Partial preview of the text

Download SPSS Mixed Linear Models Syntax for Analyzing Mixed Data and more Study notes Psychology in PDF only on Docsity!

SPSS Mixed Linear Models 1

************************ SPSS Mixed Model Syntax ******************************* *******************************************************************************/

MIXED

*** Outcome variable *** DV *** Categorical fixed effects go after BY *** BY catvar1 catvar *** Continuous (covariate) fixed effects go after WITH *** WITH time contvar

*** Request specific output *** /PRINT = *** Case processing summary: factor values, repeated measures variables, repeated measure subjects, random effects subjects & frequencies *** CPS *** Descriptive Statistics: sample sizes, means, SD of DV & covariates for each distinct combination of these factors *** DESCRIPTIVES *** Iteration History (1=print every iteration) *** HISTORY(1) *** Solution (estimates) for fixed and random effects *** SOLUTION *** Tests for covariance parameters (asymptotic SE's & Wald tests) *** TESTCOV *** Estimated covariance matrix of random effects and residuals *** G R

*** SAVE Subcommand - Saves casewise statistics to working file *** /SAVE = *** Fixed Predicted Values, their SE’s, and Satterthwaite DF Regression means without random effects *** FIXPRED SEFIXP DFFIXP *** Predicted Values, their SE’s, and Satterthwaite DF Model fitted value (includes random effects) *** PRED SEPRED DFPRED *** Residuals - data value-predicted value *** RESID *** Estimation Criteria & subcommands (defaults) – usually DON’T CHANGE THESE *** /CRITERIA = *** Confidence interval level of 95% (0-100%) *** CIN(95) *** Maximum # Iterations, Maximum Half-Stepping (positive integer) *** MXITER(100) MXSTEP(5) *** Use Fisher scoring up to iteration (positive integer) *** SCORING(1) *** Tolerance value in checking singularity (positive value) *** SINGULAR(0.000000000001) *** Convergence Criteria (non-negative value, type) - Hessian, Log-likelihood, Parameter Estimates *** HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE)

*** Method of Estimation (REML, ML) *** /METHOD = REML

*** Fixed Effects *** *** Intercept included by default, or must be specified first *** *** Can include interactions between different variables with asterisk *** *** Cannot include squared terms for categorical variables using asterisk *** /FIXED = time catvar1 catvar2 contvar timecatvar1 timecontvar |**

SPSS Mixed Linear Models 2

*** Options after | *** *** Type of Sums of Squares (1 or 3) *** SSTYPE(3) *** Specifies no intercept (as in repeated measures) *** NOINT

*** Random Effects - can have multiple random statements for different levels *** *** Intercept must be included, also specify random slopes *** /RANDOM intercept time | *** Options after | *** *** SUBJECT Identifies higher-level grouping of observations *** SUBJECT(IDvar) *** COVTYPE for Covariance Structure of G matrix (default=VC) *** COVTYPE(UN)

*** Repeated Effects - specifies residual covariance matrix *** *** Is always there, but blank by default (default VC matrix called DIAG) *** *** Specify list of variable names connected by asterisks *** /REPEATED = repeatvar *** Options after | *** *** SUBJECT = distinct combinations of values of the variables *** | SUBJECT (timeIDvar)* *** COVTYPE for covariance structure of R matrix (DIAG=VC) *** COVTYPE (DIAG)

*** Estimated Marginal Means (predicted means) *** *** Multiple EMMEANS statements are allowed - TABLES is required for each *** /EMMEANS *** Can specify tables for OVERALL, factors, or crossed factors *** *** WITH sets value of covariate to estimate around (mean is default) *** TABLES (catvar1catvar2) WITH (contvar=MEAN)* *** COMPARE gives mean diff, SE, DF, t, p for each pair of levels *** COMPARE(catvar1) *** Set reference group to compare against (all possible=default) *** *** Arguments: FIRST, LAST, category value *** REFCAT(FIRST) *** Adjustments for CI’s and p-values (LSD, BONFERRONI, SIDAK) *** ADJ(LSD)

*** TEST Subcommand for customized hypothesis tests – 1+ TESTs are allowed *** *** Fixed Effects tests must have been specified in FIXED statement *** *** Random Effects appear after | and must have appeared in RANDOM statement *** *** Values must be represented for each level of the variable *** /TEST 'Level1 vs. Level2 of CatVar1' catvar1 -1 1 0

/* Minimum specifications needed for Time within Person (random slopes) */ MIXED variable list – includes all variables, but not interactions DV (outcome variable) must be specified, and FIXED and RANDOM subcommands */

/* Two-level example: Time within Person; Random Intercepts and Slopes */

MIXED DV BY catvar1 catvar2 WITH time contvar /PRINT = SOLUTION TESTCOV G /FIXED = time catvar1 catvar2 contvar timecatvar1 timecontvar /RANDOM = intercept time | COVTYPE(UN) SUBJECT(IDVar).**