Examples (GENLINMIXED command)

The following examples correspond to the predefined distribution and link function combinations on the Target settings of the dialog.

Linear model

GENLINMIXED
  /FIELDS TARGET=y
  /TARGET_OPTIONS DISTRIBUTION=NORMAL LINK=IDENTITY
  /FIXED EFFECTS=x1 x2 x3.
  • The FIELDS subcommand specifies y as the target.
  • The TARGET_OPTIONS subcommand that the target has a normal distribution and is linearly related to the model effects.
  • The FIXED subcommand specifies a main effects model with fields x1, x2, and x3. If they are continuous, they will be treated as covariates, if categorical, they will be treated as factors.

Gamma regression

GENLINMIXED
  /FIELDS TARGET=claim_amount ANALYSISWEIGHT=number_of_claims
  /TARGET_OPTIONS DISTRIBUTION=GAMMA LINK=POWER(-1)
  /FIXED EFFECTS=holder_age vehicle_group vehicle_age
  /BUILD_OPTIONS INPUTS_CATEGORY_ORDER=DESCENDING.
  • The procedure fits a model for the target claim_amount, using holder_age, vehicle_group, and vehicle_age as main effects. In order to account for the varying number of claims used to compute the average claim amounts, you specify number_of_claims as the analysis weight.
  • The TARGET_OPTIONS specification assumes that claim_amount has a gamma distribution. A power link function with −1 as the exponent relates the distribution of claim_amount to a linear combination of the predictors, including an intercept term.
  • The BUILD_OPTIONS subcommand specifies that the category order for factors is descending values of factor levels; thus, the first category of each categorical field is used as the reference category.

(Poisson) Loglinear model

GENLINMIXED
  /FIELDS TARGET=damage_incidents OFFSET=log_months_service
  /TARGET_OPTIONS DISTRIBUTION=POISSON LINK=LOG
  /FIXED EFFECTS=type construction operation
  /BUILD_OPTIONS INPUTS_CATEGORY_ORDER=DESCENDING.
  • The procedure fits a model for the target damage_incidents, using type, construction, and operation as main effects.
  • The TARGET_OPTIONS specification assumes that damage_incidents has a Poisson distribution. A log link function relates the distribution of damage_incidents to a linear combination of the predictors, including an intercept term, and an offset equal to the values of log_months_service.
  • The BUILD_OPTIONS subcommand specifies that the category order for factors is descending values of factor levels; thus, the first category of each categorical field is used as the reference category.

Negative binomial regression

GENLINMIXED
  /FIELDS TARGET=damage_incidents OFFSET=log_months_service
  /TARGET_OPTIONS DISTRIBUTION=NEGATIVE_BINOMIAL LINK=LOG
  /FIXED EFFECTS=type construction operation.
  • The negative binomial distribution is an alternative to the Poisson when the observations are overdispersed; that is, since the mean and variance of the Poisson distribution are the same, when the data show greater variability, the negative binomial distribution can provide a better fit.

(Nominal) Multinomial logistic regression

GENLINMIXED
  /FIELDS TARGET=bfast
  /TARGET_OPTIONS DISTRIBUTION=MULTINOMIAL LINK=LOGIT
  /FIXED EFFECTS=agecat gender active.
  • The procedure fits a model for bfast using agecat, gender, and active as main effects.
  • The TARGET_OPTIONS specification assumes that bfast has a (nominal) multinomial distribution. A logit link function relates the distribution of bfast to a linear combination of the predictors, including an intercept term.

(Ordinal) Multinomial logistic regression

GENLINMIXED
  /FIELDS TARGET=chist
  /TARGET_OPTIONS DISTRIBUTION=MULTINOMIAL LINK=CLOGLOG
  /FIXED EFFECTS=numcred othnstal housng age duration.
  • The procedure fits a model for chist using numcred, othnstal, housing, age, and duration as main effects. Because numcred, othnstal, and housing have categorical measurement level, they are treated as factors; age, and duration have continuous (scale) measurement level and are treated as covariates.
  • The TARGET_OPTIONS specification assumes that chist has an (ordinal) multinomial distribution. A (cumulative) complementary log−log link function relates the distribution of chist to a linear combination of the predictors, including threshold terms for the categories of chist (except the last category).

Binary logistic regression

GENLINMIXED
  /FIELDS TARGET=default
  /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=LOGIT
  /FIXED EFFECTS=age ed employ address income debtinc creddebt othdebt.
  • The procedure fits a model for default using age, ed, employ, address, income, debtinc, creddebt, and othdebt as main effects.
  • The TARGET_OPTIONS specification assumes that default has a binomial distribution. A logit link function relates the distribution of default to a linear combination of the predictors, including an intercept term.

Binary probit model

GENLINMIXED
  /FIELDS TARGET=response TRIALS=nsubj
  /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=PROBIT
  /FIXED EFFECTS=site value.
  • The procedure fits a model for the number of responses response within trials nsubj using site and value as main effects.
  • The TARGET_OPTIONS specification assumes that response within nsubj has a binomial distribution. A probit link function relates the distribution of the target to a linear combination of the predictors, including an intercept term.

Interval censored survival

GENLINMIXED
  /FIELDS TARGET=result2
  /TARGET_OPTIONS DISTRIBUTION=BINOMIAL LINK=CLOGLOG
  /FIXED EFFECTS=duration treatment period age USE_INTERCEPT=FALSE
  /BUILD_OPTIONS TARGET_CATEGORY_ORDER=DESCENDING INPUTS_CATEGORY_ORDER=DESCENDING.
  • The procedure fits a model for the target result2, using duration, treatment, period, and age as main effects.
  • The BUILD_OPTIONS subcommand specifies that the category order for the target and all factors is descending values of factor levels; thus, the first category of each categorical field is used as the reference category.
  • The TARGET_OPTIONS specification assumes that result2 has a binomial distribution. A complementary log-log link function relates the probability of result2 to a linear combination of the predictors, excluding an intercept term.

Linear mixed model

GENLINMIXED
  /DATA_STRUCTURE SUBJECTS=school*classroom*student_id
  /FIELDS TARGET=posttest TRIALS=NONE OFFSET=NONE
  /TARGET_OPTIONS DISTRIBUTION=NORMAL LINK=IDENTITY
  /FIXED  EFFECTS=school_setting school_type teaching_method n_student 
    gender lunch pretest 
    USE_INTERCEPT=TRUE
  /RANDOM USE_INTERCEPT=TRUE SUBJECTS=school 
    COVARIANCE_TYPE=VARIANCE_COMPONENTS 
  /RANDOM USE_INTERCEPT=TRUE SUBJECTS=school*classroom 
    COVARIANCE_TYPE=VARIANCE_COMPONENTS 
  /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING 
    INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100 
    CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=MODEL
  /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD.
  • The DATA_STRUCTURE subcommand specifies that subjects are defined by school, classroom, and student_id.
  • The FIELDS and TARGET_OPTIONS subcommands specify that the procedure creates a model for posttest using a normal distribution to fit the test score and an identity link to relate the target to a linear combination of the predictors.
  • The FIXED subcommand speficies a model with school_setting, school_type, teaching_method, n_student, gender, lunch, and pretest as main effects.
  • The first RANDOM subcommand specifies an intercept-only random effect block with school as the subject field. This should account for correlation between classrooms within the same school.
  • The second RANDOM subcommand specifies an intercept-only random effect block with school*classroom as the subject field. This should account for correlation between students within the same classroom.
  • All other options are set to their default values.

For discussion of output from this syntax and to place the example in context, see Analyzing test scores .

Poisson loglinear mixed model

GENLINMIXED
  /DATA_STRUCTURE SUBJECTS=patient_id
  /FIELDS TARGET=convulsions TRIALS=NONE OFFSET=NONE
  /TARGET_OPTIONS DISTRIBUTION=POISSON LINK=LOG
  /FIXED  EFFECTS=after_t treatment*after_t USE_INTERCEPT=TRUE
  /RANDOM EFFECTS=after_t USE_INTERCEPT=TRUE 
    SUBJECTS=patient_id COVARIANCE_TYPE=UNSTRUCTURED 
  /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING 
    INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100 
    CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=MODEL
  /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD.
  • The DATA_STRUCTURE subcommand specifies that subjects are defined by patient_id.
  • The FIELDS and TARGET_OPTIONS subcommands specify that the procedure creates a model for convulsions using a Poisson distribution to fit the number of convulsions and a log link to relate the target to a linear combination of the predictors.
  • The FIXED subcommand specifies a model with after_t and treatment*after_t as effects.
  • The RANDOM subcommand specifies after_t and an intercept as effects in a random effect block with patient_id as the subject field. This should account for correlation between repeated observations of the same patient.
  • All other options are set to their default values.

For discussion of output from this syntax and to place the example in context, see Determining treatment effectiveness in a clinical trial .

Multinomial logistic mixed model

GENLINMIXED
  /DATA_STRUCTURE SUBJECTS=customer_id
  /FIELDS TARGET=service_usage TRIALS=NONE OFFSET=NONE
  /TARGET_OPTIONS DISTRIBUTION=MULTINOMIAL LINK=LOGIT
  /FIXED  EFFECTS=edcat inccat reside service_type 
    USE_INTERCEPT=TRUE
  /RANDOM USE_INTERCEPT=TRUE SUBJECTS=customer_id 
    COVARIANCE_TYPE=VARIANCE_COMPONENTS 
  /BUILD_OPTIONS TARGET_CATEGORY_ORDER=ASCENDING 
    INPUTS_CATEGORY_ORDER=ASCENDING MAX_ITERATIONS=100 
    CONFIDENCE_LEVEL=95 DF_METHOD=RESIDUAL COVB=MODEL
  /EMMEANS_OPTIONS SCALE=ORIGINAL PADJUST=LSD.
  • The DATA_STRUCTURE subcommand specifies that subjects are defined by customer_id.
  • The FIELDS and TARGET_OPTIONS subcommands specify that the procedure creates a model for service_usage using a multinomial distribution and a logit link to relate the target to a linear combination of the predictors.
  • The FIXED subcommand specifies a model with edcat, inccat, reside, and service_type as main effects.
  • The RANDOM subcommand specifies an intercept-only random effect block with customer_id as the subject field. This should account for correlation between answers to the service usage questions across service types (tv, phone, internet) within a given survey responder's answers.
  • All other options are set to their default values.

For discussion of output from this syntax and to place the example in context, see Profiling cable customers .