BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wajs
Fluorite | Level 6

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.

Thanks

 

1 ACCEPTED SOLUTION
8 REPLIES 8
PGStats
Opal | Level 21

Please post the code, or better, the log of the format and logistic proc calls.

PG
wajs
Fluorite | Level 6

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;

 

 

316 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.
317 strata group;
318 class CMV_IgG_rev (ref='2');
319 model PEstatus (event='1')= CMV_IgG_rev;
320 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.03 seconds
cpu time 0.03 seconds

 

Tom
Super User Tom
Super User

If you think the variable is numeric with single digit values then try using a format statement to make sure.

 

proc logistic data= pe. matched_21_plus_co_inf_updated;
  strata group;
  class CMV_IgG_rev (ref='2');
  format CMV_IgG_rev 1.;
  model PEstatus (event='1')= CMV_IgG_rev;
run;
wajs
Fluorite | Level 6


990 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.
991 strata group;
992 class CMV_IgG_rev (ref='2');
993 format CMV_IgG_rev 1.;
994 model PEstatus (event='1')= CMV_IgG_rev;
995 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.20 seconds
cpu time 0.12 seconds

 

 

wajs
Fluorite | Level 6

Hi,

Thanks for the guidance! There was issue with my values in throriginal dataset which I could find after running proc freq.

wajs

Tom
Super User Tom
Super User

Look at what is in your dataset.

data test;
  set PE.MATCHED_21_PLUS_CO_INF_UPDATED;
  formatted=quote(trim(vvalue( CMV_IgG_rev)));
  raw =  CMV_IgG_rev  ;
run;
proc freq ;
  tables raw*formatted / list missing;
run;
  
wajs
Fluorite | Level 6

Hi Tom,

Thanks for this advice!

Here is the output; what should do wth "."?

 

The SAS System

The FREQ Procedure
raw formatted Frequency Percent CumulativeFrequency CumulativePercent. " ."0 " 0"1 " 1"
56.4156.41
4051.284557.69
3342.3178100.00

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1336 views
  • 1 like
  • 4 in conversation