Hello,
I'm using proc phreg to model several covariates of an outcome. The continuous variables need to be log transformed, but sometimes when I run the code it works while other times I get the following error:
ERROR: An illegal argument is used in the function call in statement number 1 at line 13
column 1.
The statement was:
1 (13:1) logpreedin = LOG( preedin=0 )
I get that I can't expect SAS to calculate the log of zero, but can someone explain to me why it sometimes shows outputs for both the model and assess statements with logpreedin and sometimes I get the above error?
Here's the code:
proc phreg data=lchs.thesis_event;
class trimst: outcome;
logpreedin=log(preedin);
model time*pregint24(0)=depo bfeed outcome prev_unplanned logpreedin postedin prop_fps kept_ps sex_nocondom/ties=efron;
assess var=(logpreedin) ph/resample;
run;
Than