Sie sind auf Seite 1von 6

SAS Proc logistic 1.

Introduction

Binary response variables (for example, success failure) and ordinal response variables (none, mild, severe) arise in many fields of study. ogistic regression analysis is often used to investigate t!e relations!ip bet"een t!e response probability and t!e explanatory variables. #!e model most often used is t!e binary response model. #!e simplest model for ordinal response data involves parallel lines construction on some appropriately c!osen scale. $or t!e log%odds scale, t!e parallel lines regression model is often referred to as t!e proportional odds model. &. Syntax

P'() (*IS#I) options+ ,(-. response/independents0 options+ 01 re2uired 10 3.I*4# variable%list+ $'.5 variable%list+ (6#P6# 7(6#/ SAS%data%set8 79ey"ord/ name...9ey"ord/ name8 70A P4A/ value8+ 7label:8 #.S# e2uation1 7,...,e2uation98 70option8+ 6;I#S independent1/list1 7...independent9/list98 70option8+ B< variable%list+ =. -etails a) P'() (*IS#I) options+

#!e follo"ing are valid options for t!e P'() (*IS#I) statement: -A#A/ )(>(6# -.S).;-I;* I;.S#/ ;(P'I;# ('-.'/ (6#.S#/ SI,P . )(>(6# #!e )(>(6# option re2uests t!at t!e (6#.S#/ SAS%data%set contain t!e estimated covariance matrix as "ell as t!e parameter estimates. (6#.S#/ must be specified for )(>(6# to !ave an effect. -.S).;-I;* #!e -.S).;-I;* option reverses t!e sort order for t!e levels of t!e response variable. If t!e ('-.'/ option is also specified, t!en t!e levels are first ordered according to t!e ('-.'/ option and t!en t!at order is reversed. I;.S#/ Sas%data%set #!e I;.S#/ option specifies a SAS data set t!at contains initial values for all parameters in t!e (*IS#I) model. By%group processing is allo"ed "it! t!e I;.S#/ data set. ('-.'/ -A#A ? I;#.';A ? $(',A##.#!e ('-.'/ option specifies t!e order in "!ic! you "ant t!e levels of t!e response variable (specified in t!e ,(-. statement) to be sorted. 3!en you specify ('-.'/ -A#A , t!e levels are sorted by t!e order of appearance in t!e input data set. 3!en you specify ('-.'/ I;#.';A , t!e

levels are sorted by t!e unformatted value. 3!en you specify ('-.'/ $(',A##.- , t!e levels are ordered by t!e external formatted value. #!e default is: ('-.'/ $(',A##.- , unless t!ere is no user%specified format for t!e response variable+ t!en t!e default is ('-.'/ I;#.';A . (6#.S#/ SAS%data%set #!e (6#.S#/ option specifies t!e name of a SAS data set (t!e (6#.S#/ SAS%data%set ) to contain t!e estimated regression coefficients and, optionally, t!eir estimated covariances. SI,P . #!e SI,P . option prints simple statistics (mean, standard deviation, minimum, maximum) for eac! explanatory variable in t!e ,(-. statement. b) ,(-. variable/independents0 options + ,(-. events0trials/independents0 options + #"o forms of ,(-. syntax can be specified. #!e first form, referred to as t!e actual ,(-. syntax, is applicable to bot! binary response data and ordinal response data. #!e second form, referred to as t!e events0trials ,(-. syntax, is restricted to t!e binary response data case. (nly one ,(-. statement can be used "it! eac! invocation of P'() (*IS#I). >ariable: is t!e name of t!e response variable. .vents: is t!e name of a variable t!at contains t!e number of positive responses (or events). #rials: is t!e name of a variable t!at contains t!e total number of positive and negative responses (or trials). Independents: are t!e names of independent (or explanatory) variables. #!e follo"ing are t!e six areas into "!ic! t!e ,(-. Statement options !ave been divided: ,odel Specification (ptions ,odel Building (ptions ,odel $itting (ptions (utput and Printing (ptions )lassification #able (ptions 'egression -iagnostics (ptions (1) ,odel Specification (ptions B.S#/ I;@/ ;($I# ;(I;# ($$S.#/ P.>.;#/ S. .)#I(;/ B.S#/ #!e B.S#/ option is used "it! t!e S)('. model%selection met!od. If S. .)#I(;/ S)('., t!e B.S#/ option specifies t!e maximum number of subset models to be printed for eac! siAe. If B.S#/ option is omitted and t!e number of explanatory variables does not exceed 1B, all possible subsets are evaluated. If B.S#/ option is omitted and t!e number of explanatory variables exceeds 1B, t!e number of subsets selected is at most e2ual to t!e number of explanatory variables. I;@/ ) (* (* ? (*I# ? ;(',I# #!e I;@/ option specifies t!e lin9 function for t!e response probabilities. ) (* (* is t!e complementary log%log function, (*I# is t!e log odds function, and ;(',I# is t!e inverse standard normal probability integral function. -efault: (*I# ;($I# #!e ;($I# option prints t!e result of t!e global score test. It tests t!e Coint significance of t!e explanatory variables in t!e ,(-. statement. 3!en ;($I# is specified, no parameters are estimated.

;(I;# #!e ;(I;# option suppresses t!e intercept from a binary response model. $or an ordinal response model, it suppresses t!e first intercept. ($$S.#/ variable #!e ($$S.#/ option specifies t!e name of an offset variable, "!ic! is an explanatory variable "it! a regression coefficient fixed as one. P.>.;#/ number%list #!e P.>.;#/ option specifies a list of prior probabilities for t!e event of interest. #!e false positive and false negative rates are t!en computed by BayesD rule. #!e prior probability is also used to compute t!e rate of correct prediction, and for eac! prior probability in t!e list, a classification table of all observations is computed. By default, t!e prior probability is t!e sample proportion of events . #!e P.>.;#/ option !as no effect if t!e )#AB . option is not specified. S. .)#I(;/ BA)@3A'- ? B $('3A'- ? $ ;(;. ? ; S#.P3IS. ? S S)('. #!e S. .)#I(;/ option specifies t!e met!od used to select t!e explanatory variables in t!e model. BA)@3A'- re2uests bac9"ard elimination, $('3A'- re2uests for"ard selection, ;(;. re2uests t!e t!e fitting of t!e complete model specified in t!e ,(-. statement, S#.P3IS. re2uests step"ise selection, and S)('. finds a specified number of models "it! t!e !ig!est Score c!i%s2uare in a range of model siAes (see B.S#/ option). -efault: ;(;. (&) ,odel Building (ptions -.#AI S $AS# I;) 6-./ ,AES#.P/ S.56.;#IA S#(P/ S#(P'.S S .;#'</ S S#A</ S#A'#/

-.#AI S #!e -.#AI S option produces detailed printout at eac! step of t!e model%building process. $AS# #!e $AS# option re2uests t!e use of a computational algorit!m of a"less and Sing!al (1FGH) to compute a first order approximation to t!e remaining slope estimates for eac! subse2uent elimination of a variable from t!e model. I;) 6-./ n #!e I;) 6-. option re2uests t!at t!e first n explanatory variables in t!e ,(-. statement be included in every model. -efault: B ,AES#.P/ n #!e ,AES#.P/ option specifies t!e maximum number of times t!e explanatory variables move in and out of t!e model "!en S. .)#I(;/ S#.P3IS.. #!e default number is t"ice t!e number of explanatory variables in t!e ,(-. statement. S.56.;#IA #!e S.56.;#IA option forces variable to be added in t!e order specified in t!e ,(-. statement, or eliminated in t!e reverse order specified in t!e ,(-. statement. S .;#'< ? S ./ value #!e S .;#'< option specifies t!e significance level for entry into t!e model used in S. .)#I(;/ $('3A'- and S. .)#I(;/ S#.P3IS.. -efault: B.BI S S#A< ? S S/ value

#!e S S#A</ option specifies t!e significance level for staying in t!e model used in S. .)#I(;/ BA)@3A'- and S. .)#I(;/ S#.P3IS.. -efault: B.BI S#A'#/ n #!e S#A'#/ option specifies t!at t!e first n explanatory variables in t!e ,(-. statement be used to begin t!e selection process. -efaults: B for S. .)#I(;/ $('3A'- or S. .)#I(;/ S#.P3IS.+ t!e number of explanatory variables in t!e ,(-. statement for S. .)#I(;/ BA)@3A'-. S#(P/ n #!e S#(P/ option specifies t!e maximum (if S. .)#I(;/ $('3A'-) or minimum (if S. .)#I(;/ BA)@3A'-) number of explanatory variables t!at t!e final model can !ave. -efaults: B for S. .)#I(;/ BA)@3A'-+ t!e number of explanatory variables in t!e ,(-. statement for S. .)#I(;/ $('3A'-. S#(P'.S ? S' #!e S#(P'.S option specifies removal or entry of variables based on t!e value of t!e residual c!i% s2uare. If S. .)#I(;/$('3A'- is re2uested, it causes t!e explanatory variables to be entered into t!e model one at a time until t!e residual c!i%s2uare becomes insignificant (i.e., until t!e p%value of t!e residual c!i%s2uare exceeds t!e S .;#'</ value). If S. .)#I(;/ BA)@3A'- is re2uested, it causes t!e explanatory variables to be removed from t!e model one at a time until t!e residual c!i%s2uare becomes significant (i.e., until t!e p%value of t!e residual c!i%s2uare falls s!ort of t!e S S#A</ value). (=) ,odel $itting (ptions )(;>.'*./ I;I#IA / I;#.').P#/ ,AEI#.'/ ;()4.)@ P )(;>/ SI;*6 A'/ #.)4;I56./ )(;>.'*./ value #!e )(;>.'*./ option specifies t!e convergence criterion. #!e iterations are considered to !ave converged "!en t!e maximum c!ange (absolute or relative) in parameter estimates bet"een successive steps is less t!an t!e value specified. #!e c!ange is a relative c!ange if t!e parameter is greater t!an B.B1 in absolute value+ ot!er"ise it is an absolute c!ange. -efault: 1.%J I;I#IA / value%list #!e I;I#IA / option sets initial values for t!e slope parameters in t!e model, and t!e values must be given in t!e order t!at t!e parameters are listed in t!e ,(-. statement. By default, all initial estimates are Aero unless t!e ($$S.#/ option is specified, in "!ic! case initial estimates are obtained as "eig!ted least s2uares estimates based on a simple clustering of t!e data. I;#.').P#/ value%list #!e I;#.').P#/ option sets initial values for t!e intercept parameters in t!e model. By default, t!e initial estimates are t!e cumulative proportions of observations t!at correspond to t!e parameters , unless t!e ($$S.#/ option is specified. In t!at case, initial estimates are obtained as "eig!ted least s2uares estimates based on a simple clustering of t!e data. ,AEI#.'/ n #!e ,AEI#.'/ option specifies t!e maximum number of iterations to perform. -efault: &I ;()4.)@ #!e ;()4.)@ option suppresses t!e c!ec9 to determine "!et!er maximum li9eli!ood estimates of t!e regression parameters exist. If you are sure t!at t!e estimates are finite, t!is option can reduce t!e execution time if t!e estimation ta9es more t!an eig!t iterations.

P )(;>/ value #!e P )(;>/ option controls t!e convergence criterion for confidence intervals based on t!e profile li9eli!ood function. #!e value must be positive, and t!e default value is 1.%J . #!e option !as no effect unless eit!er t!e P ) or P ' option is specified. SI;*6 A'/ value #!e SI;*6 A'/ option specifies t!e tolerance for testing t!e singularity of t!e expected value of t!e !essian matrix. #!e test re2uires t!at a pivot for s"eeping t!is matrix be at least t!is number times a norm of t!e matrix. -efault: 1.%1& #.)4;I56./ 9ey"ord #!e #.)4;I56./ option specifies t!e optimiAation tec!ni2ue for estimating t!e regression parameters. >alid 9ey"ords are $IS4.' ? $S ? .EP.)#.- and ;.3#(; ? ;' ? (BS.'>.-. #.)4;I56./$IS4.' , "!ic! is t!e default, specifies t!e $is!er Scoring met!od. #.)4;I56./;.3#(; specifies t!e ;e"ton%'ap!son met!od. Bot! tec!ni2ues yield t!e same estimates, but t!e estimated covariance mitrices are slig!tly different, except for t!e case "!en t!e (*I# lin9 is specified for binary response data. (J) (utput and Printing (ptions A**'.*A#. A P4A/ ) )(''B )(>B I#P'I;# A)@$I# P ) 'IS@ I,I#S '().PS/ 'S56A'. S)A ./ 3A -) 3A -' NOTE: for details see SAS online manual (I) )lassification #able (ptions )#AB . PP'(B/ )#AB . #!e )#AB . option re2uests t!e printing of a classification table for t!e final model produced by t!e procedure. #!is option is available only for binary response data. PP'(B/ (values) #!e PP'(B/ option specifies possibly multiple cutpoints used to classify observations for t!e )#AB . option. #!e values must be bet"een B and 1. If t!e PP'(B/ option is not specified, t!e default is to print t!e classification for a range of probabilities from t!e smallest estimated probability (rounded belo" to t!e nearest .B&) to t!e !ig!est estimated probability (rounded above to t!e nearest .B&) "it! B.B& increments. ;ote t!at t!e PP'(B/ option !as no effect unless t!e )#AB . option is also specified. (K ) 'egression -iagnostics (ptions I;$ 6.;). IP (#S I;$ 6.;). #!e I;$ 6.;). option re2uests t!e display of diagnostic measures for identifying influential observations in t!e case of a binary response model. IP (#S #!e IP (#S option re2uests t!e printing of an index plot (a scatter plot "it! case number as t!e !oriAontal axis) for eac! regression diagnostic statistic. (c) 3.I*4# variable%list 70;(',A IL.8 + 3!en a 3.I*4# statement appears, eac! observation in t!e input data set is "eig!ted by t!e value P ' (6#'()/

of t!e 3.I*4# variable. (bservations "it! nonpositive or missing values for t!e 3.I*4# variable do not contribute to t!e analysis. (d) $'.5 variable%list+ #!e $'.5 statement identifies a variable t!at contains t!e fre2uency of occurrence of eac! observation. P'() (*IS#I) treats eac! observation as if it appears n times, "!ere n is t!e value of t!e $'.5 variable for t!e observation. If n is not an integer, t!e fre2uency value is truncated to an integer. If t!e fre2uency value is less t!an 1 or missing, t!e observation is not used. (e) (6#P6# (6#/ SAS%data%set P'.-I)#.-?P'.-?P'(B?P/ name (3.'? / name 6PP.'?6/ name EB.#A/ name S#-B.#A/ name 4/ name '.S)4I/ name '.S-.>/ name -$B.#AS/ names )/ name )BA'/ name -I$)4IS5/ name -I$-.>/ name 0A P4A/ value+ NOTE: For more details, see SAS online manual (f) 6;I#S independent1/list1 7...independent9/list9 8 7 0 option 8 + #!e 6;I#S statement enables you to specify units for t!e explanatory variables so t!at customiAed odds ratios can be estimated. An estimate of t!e corresponding odds ratio is printed for eac! unit specified for an explanatory variable. In t!e syntax, independent is t!e name of an explanatory variable, and list represents units t!at are of interest for t!at variable. .ac! unit in a list is of one of t!e follo"ing forms: value, S-, %S-, or value1S-, "!ere t!e value is any nonAero number, and S- is t!e sample standard deviation of t!e corresponding independent variable. #!e follo"ing option can be specified after a slas! (0):-.$A6 #/ list #!e -.$A6 #/ option gives a list of units for all explanatory variables t!at are not specified in t!e 6;I#S statement. If t!e -.$A6 #/ option is not specified, t!e procedure does not produce customiAed odds ratio estimates for any explanatory variable t!at is not listed in t!e 6;I#S statement.

Das könnte Ihnen auch gefallen