Syntax


The PROC TPHREG statement invokes the TPHREG procedure. All the other statements in the PHREG procedure (with the exception of the experimental ASSESS statement) are available in the TPHREG procedure. The MODEL statement in the TPHREG procedure enables you to specify explanatory effects, not just individual continuous variables, and has additional options specifically for having CLASS variables . In addition, you can specify the CLASS statement and the CONTRAST statement as follows :

  • CLASS variable < (options) > <variable < (options) > > < / options > ;

  • CONTRAST 'label' effect values < , effect values > < / options > ;

The PROC TPHREG statement and the MODEL statement are required. The CLASS statement (if used) must precede the MODEL statement, and CONTRAST statements (if used) must follow the MODEL statement. The CLASS statement specifies the categorical variables to be used as explanatory variables. Variables specified in the CLASS statement have to exist in the input data. You cannot use programming statements to modify their values. The CONTRAST statement tests customized hypotheses concerning the regression parameters and estimates the parameters for the corresponding rows of contrasts.

PROC TPHREG Statement

  • PROC TPHREG < options > ;

All PROC PHREG statement options can be used in the PROC TPHREG statement. In addition, you can specify the following option:

NAMELEN= n

  • specifies the length of effect names in tables and output data sets to be n characters , where n is a value between 20 and 200. The default length is 20 characters.

MODEL Statement

  • MODEL time < * censor (list) > = effects < /options > ;

  • MODEL (t1, t2) < *censor(list) > = effects < /options > ;

The specifications of the time variables, the censoring indicator, and censored values are same as those in the PHREG procedure. The model effects , which follow the equal sign, include continuous or CLASS variables as the main effects. Categorical variables, which can be character or numeric, must be declared in the CLASS statement. Crossed and nested effects can be specified in the same fashion as in the GLM procedure (see the section 'Specification of Effects' on page 1784 of Chapter 32, 'The GLM Procedure,' for more information).

Any MODEL statement options in the PHREG procedure can be used in the TPHREG procedure. To accommodate the broader specification of model effects, the variable-selection options INCLUDE=, START=, and STOP= have been modified.

INCLUDE= n

  • includes the first n effects in the MODEL statement in every model. By default, INCLUDE=0. The INCLUDE= option has no effect when SELECTION=NONE.

START= n

  • begins the FORWARD, BACKWARD, or STEPWISE selection process with the first n effects listed in the MODEL statement. The value of n ranges from 0 to s , where s is the total number of effects in the MODEL statement. The default value of n is s for the BACKWARD method and 0 for the FORWARD and STEPWISE methods . Note that START= n specifies only that the first n effects appear in the first model, while INCLUDE= n requires that the first n effects be included in every model. For the SCORE method, START= n specifies that the smallest models contain n effects, where n ranges from 1 to s ; the default value is 1. The START= option has no effect when SELECTION=NONE.

STOP= n

  • specifies the maximum (FORWARD method) or minimum (BACKWARD method) number of effects to be included in the final model. The effect selection process is stopped when n effects are found. The value of n ranges from 0 to s , where s is the total number of effects in the MODEL statement. The default value of n is s for the FORWARD method and 0 for the BACKWARD method. For the SCORE method, STOP= n specifies that the smallest models contain n effects, where n ranges from 1 to s ; the default value of n is s . The STOP= option has no effect when SELECTION=NONE or STEPWISE.

  • Two new options are added to the MODEL statement in the TPHREG procedure.

HIERARCHY= keyword

HIER= keyword

  • specifies whether and how the model hierarchy requirement is applied and whether a single effect or multiple effects are allowed to enter or leave the model in one step. You can specify that only CLASS variable effects, or both CLASS and continuous variable effects, be subject to the hierarchy requirement. The HIERARCHY= option is ignored unless you also specify the FORWARD, BACKWARD, or STEPWISE selection method.

  • Model hierarchy refers to the requirement that, for any term to be in the model, all effects contained in the term must be present in the model. For example, in order for the interaction A*B to enter the model, the main effects A and B must be in the model. Likewise, neither effect A nor B can leave the model while the interaction A*B is in the model.

  • The keywords you can specify in the HIERARCHY= option are described as follows:

    NONE

    Model hierarchy is not maintained . Any single effect can enter or leave the model at any given step of the selection process.

    SINGLE

    Only one effect can enter or leave the model at one time, subject to the model hierarchy requirement. For example, suppose that you specify the main effects A and B and the interaction of A*B in the model. In the first step of the selection process, either A or B can enter the model. In the second step, the other main effect can enter the model. The interaction effect can enter the model only when both main effects have already been entered. Also, before A or B can be removed from the model, the A*B interaction must first be removed. All effects (CLASS and continuous variables) are subject to the hierarchy requirement.

    SINGLECLASS

    This is the same as HIERARCHY=SINGLE except that only CLASS effects are subject to the hierarchy requirement.

    MULTIPLE

    More than one effect can enter or leave the model at one time, subject to the model hierarchy requirement. In a forward selection step, a single main effect can enter the model, or an interaction can enter the model together with all the effects that are contained in the interaction. In a backward elimination step, an interaction itself, or the interaction together with all the effects that the interaction contains, can be removed. All effects (CLASS and continuous variable) are subject to the hierarchy requirement.

    MULTIPLECLASS

    This is the same as HIERARCHY=MULTIPLE except that only CLASS effects are subject to the hierarchy requirement.

  • The default value is HIERARCHY=SINGLE, which means that model hierarchy is to be maintained for all effects (that is, both CLASS and continuous variable effects) and that only a single effect can enter or leave the model at each step.

NODUMMYPRINT

NODESIGNPRINT

NODP

  • suppresses the 'Class Level Information' table, which shows how the design matrix columns for the CLASS variables are coded.

CLASS Statement

  • CLASS variable < (options) > < variable < (options) > > < / options > ;

The CLASS statement names the categorical variables to be used in the analysis. The CLASS statement must precede the MODEL statement. You can specify various options for each variable by enclosing them in parentheses after the variable name . You can also specify global options for the CLASS statement by placing them after a slash (/). Global options are applied to all the variables specified in the CLASS statement. If you specify more than one CLASS statement, the global options specified on any one CLASS statement apply to all CLASS statements. However, individual CLASS variable options override the global options .

CPREFIX= n

  • specifies that, at most, the first n characters of a CLASS variable name be used in creating names for the corresponding dummy variables. The default is 32 ˆ’ min(32 , max(2 , f )), where f is the formatted length of the CLASS variable.

DESCENDING

DESC

  • reverses the sorting order of the categorical variable.

LPREFIX= n

  • specifies that, at most, the first n characters of a CLASS variable label be used in creating labels for the corresponding dummy variables.

MISSING

  • allows missing value (for example, ˜.' for a numeric variable and blanks for a character variable) as a valid value for the CLASS variable.

ORDER=DATA FORMATTED FREQ INTERNAL

  • specifies the sorting order for the categories of cateogrical variables. This ordering determines which parameters in the model correspond to each level in the data, so the ORDER= option may be useful when you use the CONTRAST statement. When the default ORDER=FORMATTED is in effect for numeric variables for which you have supplied no explicit format, the levels are ordered by their internal values. The following table shows how PROC TPHREG interprets values of the ORDER= option.

    Value of ORDER=

    Levels Sorted By

    DATA

    order of appearance in the input data set

    FORMATTED

    external formatted value, except for numeric variables with no explicit format, which are sorted by their unformatted (internal) value

    FREQ

    descending frequency count; levels with the most observations come first in the order

    INTERNAL

    unformatted value

  • By default, ORDER=FORMATTED. For FORMATTED and INTERNAL, the sort order is machine dependent. For more information on sorting order, see the chapter on the SORT procedure in the SAS Procedures Guide and the discussion of BY- group processing in SAS Language Reference: Concepts .

PARAM= keyword

  • specifies the parameterization method for the categorical variable or variables. Design matrix columns are created from CLASS variables according to the following coding schemes. The default is PARAM=REF. If PARAM=ORTHPOLY or PARAM=POLY, and the CLASS levels are numeric, then the ORDER= optioninthe CLASS statement is ignored, and the internal, unformatted values are used. See the 'CLASS Variable Parameterization' section on page 4482 for further details.

    EFFECT

    specifies effect coding

    GLM

    specifies less-than -full-rank, reference- cell coding; this option can only be used as a global option

    ORDINAL

    specifies the cumulative parameterization for an ordinal CLASS variable.

    POLYNOMIAL POLY

    specifies polynomial coding

    REFERENCE REF

    specifies reference cell coding

    ORTHEFFECT

    orthogonalizes PARAM=EFFECT

    ORTHORDINAL

    orthogonalizes PARAM=ORDINAL

    ORTHPOLY

    orthogonalizes PARAM=POLYNOMIAL

    ORTHREF

    orthogonalizes PARAM=REFERENCE

  • The EFFECT, POLYNOMIAL, REFERENCE, ORDINAL, and their orthogonal parameterizations are full rank parameterization. The REF= option in the CLASS statement determines the reference level for the EFFECT, REFERENCE, and their orthogonal parameterizations.

  • Parameter names for a CLASS predictor variable are constructed by concatenating the CLASS variable name with the CLASS levels. However, for the POLYNOMIAL and orthogonal parameterizations, parameter names are formed by concatenating the CLASS variable name and keywords that reflect the parameterization.

REF= ' level ' keyword

  • specifies the reference level for PARAM=EFFECT or PARAM=REF. For an individual variable, you can specify a specific level of the variable in the REF= option. For a global or individual variable REF= option , you can use one of the following keywords . The default is REF=LAST.

    FIRST

    designates the first ordered level as reference

    LAST

    designates the last ordered level as reference

TRUNCATE

  • specifies that class levels should be determined using no more than the first 16 characters of the formatted values of CLASS variables. This is a global option, not an individual CLASS variable option.

CONTRAST Statement

  • CONTRAST 'label' row-description < , row-description >< / options > ;

  • where a row-description is: effect values < , effect values >

The CONTRAST statement provides a mechanism for obtaining customized hypothesis tests. It is similar to the CONTRAST statement in PROC GLM and PROC CATMOD, depending on the coding schemes used with any categorical variables involved.

The CONTRAST statement enables you to specify a matrix, L , for testing the hypothesis L ² = 0. You must be familiar with the details of the model parameterization that PROC TPHREG uses (for more information, see the PARAM= option in the 'CLASS Statement' section on page 4477). Optionally, the CONTRAST statement enables you to estimate each row, , of L ² and test the hypothesis = 0. Computed statistics are based on the asymptotic chi-square distribution of the Wald statistic.

There is no limit to the number of CONTRAST statements that you can specify, but they must appear after the MODEL statement.

The following parameters are specified in the CONTRAST statement:

label

identifies the contrast on the output. A label is required for every contrast specified, and it must be enclosed in quotes.

effect

identifies an effect that appears in the MODEL statement. You do not need to include all effects that are included in the MODEL statement.

values

are constants that are elements of the L matrix associated with the effect. To correctly specify your contrast, it is crucial to know the ordering of parameters within each effect and the variable levels associated with any parameter. The 'Class Level Information' table shows the ordering of levels within variables. The E option, described later in this section, enables you to verify the proper correspondence of values to parameters.

The rows of L are specified in order and are separated by commas. Multiple degree-of-freedom hypotheses can be tested by specifying multiple row-descriptions . For any of the full-rank parameterizations, if an effect is not specified in the CONTRAST statement, all of its coefficients in the L matrix are set to 0. If too many values are specified for an effect, the extra ones are ignored. If too few values are specified, the remaining ones are set to 0.

When you use effect coding (by specifying PARAM=EFFECT in the CLASS statement), all parameters are directly estimable (involve no other parameters). For example, suppose an effect coded CLASS variable A has four levels. Then there are three parameters ( ± 1 , ± 2 , ± 3 ) representing the first three levels, and the fourth parameter is represented by

To test the first versus the fourth level of A , you would test

click to expand

or, equivalently,

click to expand

which, in the form L ² = 0, is

click to expand

Therefore, you would use the following CONTRAST statement:

  contrast '1 vs. 4' A 2 1 1;  

To contrast the third level with the average of the first two levels, you would test

or, equivalently,

click to expand

Therefore, you would use the following CONTRAST statement:

  contrast '1&2 vs. 3' A 1 1   2;  

Other CONTRAST statements are constructed similarly. For example,

  contrast '1 vs. 2    ' A 1 -1 0;   contrast '1&2 vs. 4  ' A 3  3 2;   contrast '1&2 vs. 3&4' A 2  2 0;   contrast 'Main Effect' A 1  0 0,   A 0  1 0,   A 0  0 1;  

When you use the less-than-full-rank parameterization (by specifying PARAM=GLM in the CLASS statement), each row is checked for estimability. If PROC TPHREG finds a contrast to be nonestimable, it displays missing values in corresponding rows in the results. PROC TPHREG handles missing level combinations of categorical variables in the same manner as PROC GLM. Parameters corresponding to missing level combinations are not included in the model. This convention can affect the way in which you specify the L matrix in your CONTRAST statement. If the elements of L are not specified for an effect that contains a specified effect, then the elements of the specified effect are distributed over the levels of the higher-order effect just as the GLM procedure does for its CONTRAST and ESTIMATE statements. For example, suppose that the model contains effects A and B and their interaction A*B. If you specify a CONTRAST statement involving A alone, the L matrix contains nonzero terms for both A and A*B, since A*B contains A.

The degrees of freedom is the number of linearly independent constraints implied by the CONTRAST statement, that is, the rank of L .

You can specify the following options after a slash (/).

ALPHA= p

  • specifies the level of significance p for the 100(1 ˆ’ p )% confidence interval for each contrast when the ESTIMATE option is specified. The value p must be between 0 and 1. By default, p is equal to the value of the ALPHA= option in the PROC TPHREG statement, or 0.05 if that option is not specified.

E

  • requests that the L matrix be displayed.

ESTIMATE= keyword

  • requests that each individual contrast (that is, each row, , of L ² ) or exponentiated contrast ( ) be estimated and tested. PROC TPHREG displays the point estimate, its standard error, a Wald confidence interval, and a Wald chi-square test for each contrast. The significance level of the confidence interval is controlled by the ALPHA= option. You can estimate the contrast or the exponentiated contrast ( ), or both, by specifying one of the following keywords :

    PARM

    specifies that the contrast itself be estimated

    EXP

    specifies that the exponentiated contrast be estimated

    BOTH

    specifies that both the contrast and the exponentiated contrast be estimated

SINGULAR = number

  • tunes the estimability check. This option is ignored when the full-rank parameterization is used. If v is a vector, define ABS( v ) to be the largest absolute value of the elements of v . For a row vector l ² of the contrast matrix L ,define c to be equal to ABS( l ) if ABS( l ) is greater than 0; otherwise , c equals 1. If ABS( l ² ˆ’ l ² T ) is greater than c * number , then l is declared nonestimable. The T matrix is the Hermite form matrix I , where represents a generalized inverse of the information matrix I of the null model. The value for number must be between 0 and 1; the default value is 1E ˆ’ 4.




SAS.STAT 9.1 Users Guide (Vol. 6)
SAS.STAT 9.1 Users Guide (Vol. 6)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net