Hi, I am working on a dataset with microorganisms. For Proc format, my values are CMV_IgG_rev 1.'Present', 2.'Absent'. In Proc logistic, I put (ref='Absent') or (ref='2'), log turns out invalid reference value. Please guide me
Hi,
proc logistic data= pe. matched_21_plus_co_inf_updated;
strata group;
class CMV_IgG_rev (ref='2');
model PEstatus (event='1')= CMV_IgG_rev;
run;
Log:
288 proc logistic data= pe. matched_21_plus_co_inf_updated;
NOTE: Data file PE.MATCHED_21_PLUS_CO_INF_UPDATED.DATA is in a format that is native to another
host, or the file encoding does not match the session encoding. Cross Environment Data Access
will be used, which might require additional CPU resources and might reduce performance.
289 strata group;
290 class CMV_IgG_rev (ref='2');
291 model PEstatus (event='1')= CMV_IgG_rev;
292 run;
ERROR: Invalid reference value for CMV_IgG_rev.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 78 observations read from the data set PE.MATCHED_21_PLUS_CO_INF_UPDATED.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.08 seconds
cpu time 0.04 seconds
Why do you have quotes around a numeric value?
Hi, Thanks for the advice! Here is the output:
group | Num | 8 | BEST12. | BEST12. |
type | Char | 7 | ||
ID | Char | 4 | $100. | $100. |
PEstatus | Num | 8 | BEST12. | BEST12. |
CMV_IgG_rev | Num | 8 | BEST12. | BEST12. |
Thanks for the guidance!
After removing quotes, here is the log, it was the same whether I used format statement or not:
NOTE: The SAS System stopped processing this step because of errors.
307 strata group;
308 class CMV_IgG_rev (ref=2);
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, FIRST, LAST.
ERROR 200-322: The symbol is not recognized and will be ignored.
309 model PEstatus (event='1')= CMV_IgG_rev;
310 run;
Sorry to say, I'm unable to help further. I don't have access to LOGISTIC any more for testing purposes.
There must be a few stat gurus lurking who can finish this one!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.