* Read in Rat Pup data .
GET DATA
/TYPE = TXT
/FILE = 'C:\temp\rat_pup.dat'
/DELCASE = LINE
/DELIMITERS = "\t"
/ARRANGEMENT = DELIMITED
/FIRSTCASE = 2
/IMPORTCASE = ALL
/VARIABLES =
pup_id F2.1
weight F4.2
sex A6
litter F1.0
litsize F2.1
treatment A7
.
CACHE.
EXECUTE.
Because the MIXED command in SPSS sets the fixed-effect parameter associated with
the highest-valued level of a fixed factor to 0 by default, to prevent overparameterization
of models (similar to Proc Mixed in SAS; see Subsection 3.4.1), the highest-valued levels
of fixed factors can be thought of as “reference categories” for the factors. As a result, we
recode TREATMENT into a new variable named TREAT, so that the control group (TREAT
= 3) will be the reference category.
* Recode TREATMENT variable .
RECODE
treatment
('High'=1) ('Low'=2) ('Control'=3) INTO treat .
EXECUTE .
VARIABLE LABEL treat “Treatment”.
VALUE LABELS treat 1 "High" 2 "Low" 3 "Control".
MIXED
weight BY treat sex WITH litsize
/CRITERIA = CIN(95) MXITER(100) MXSTEP(5) SCORING(1)
SINGULAR(0.000000000001) HCONVERGE(0, ABSOLUTE) LCONVERGE(0,
ABSOLUTE) PCONVERGE(0.000001, ABSOLUTE)
/FIXED = treat sex litsize treat*sex | SSTYPE(3)
/METHOD = REML
/PRINT = SOLUTION
/RANDOM INTERCEPT | SUBJECT(litter) COVTYPE(VC)
/SAVE = PRED RESID .
- The first variable listed after invoking the MIXED command is the dependent variable, WEIGHT. The BY keyword indicates that the TREAT and SEX variables are to be considered as categorical factors (they can be either fixed or random). Note that we do not need to include LITTER as a factor, because this variable is identified as a SUBJECT variable later in the code. The WITH keyword identifies continuous covariates, and in this case, we specify LITSIZE as a continuous covariate.
- The CRITERIA subcommand specifies default settings for the convergence criteria obtained by specifying the model using the menu system.
- In the FIXED subcommand, we include terms that have fixed effects associated with them in the model: TREAT, SEX, LITSIZE and the TREAT × SEX interaction. The SSTYPE(3) option after the vertical bar indicates that the default Type III analysis is to be used when calculating F-statistics. We also use the METHOD = REML subcommand, which requests that the REML estimation method (the default) be used. The SOLUTION keyword in the PRINT subcommand specifies that the estimates of the fixed-effect parameters, covariance parameters, and their associated standard errors are to be included in the output.
- The RANDOM subcommand specifies that there is a random effect in the model associated with the INTERCEPT for each level of the SUBJECT variable (i.e., LITTER). The information about the “subject” variable is specified after the vertical bar (|). Note that because we included LITTER as a subject variable, we did not need to list it after the BY keyword (including LITTER after BY does not affect the analysis if LITTER is also indicated as a SUBJECT variable). The COVTYPE(VC) option indicates that the default Variance Components covariance structure for the random effects (the D matrix) is to be used. We did not need to specify a COVTYPE here because only a single variance associated with the random effects is being estimated.
- Conditional predicted values and residuals are saved in the working data set by specifying PRED and RESID in the SAVE subcommand. The keyword PRED saves litter-specific predicted values that incorporate both the estimated fixed effects and the EBLUPs of the random litter effects for each observation. The keyword RESID saves the conditional residuals that represent the difference between the actual value of WEIGHT and the predicted value for each rat pup, based on the estimated fixed effects and the EBLUP of the random effect for each observation. The set of population-averaged predicted values, based only on the estimated fixed-effect parameters, can be obtained by adding the FIXPRED keyword to the /SAVE subcommand, as shown later in this chapter (see Section 3.9 for more details): /SAVE = PRED RESID FIXPRED
PLease read the following attachment for detail:
SPSS01.pdf
(1.43 MB)


雷达卡



京公网安备 11010802022788号







