@Dylannn3 wrote:
Ran the proc freq and this is what it is showing me
Which tells use that your Agegroup variable has already been collapsed to represent some range of ages and does not have any values greater than 1. You need to go to the source of the data to find out what 0 and 1 represent.Likely the 1 means in some specific range of ages and 0 all the other ages. But without documentation somewhere the range is unknown.
Or find an actual age variable somewhere (might have really different name) or possibly a variable containing date of birth and calculate an age at a given point in that that you can used to make your Agegrp2.
Normally such SAS messages are correct. To verify what you've got you could run:
proc freq data=logis;
table agegrp2;
run;
Or show the LOG from running the data step. Copy the data step code and all notes, messages, warnings or errors. Then on the forum open a text box and paste all that text.
Hi so you were correct about the "age" variable being missed labeled. I updated it to "agegrp" which is the correct variable name but I still can't get the code to run.
I also ran this proc:
proc freq data=logis;
table agegrp2;
run;
To see the frequencies and it came up blank.
After updating the variable here is the new log (with error still):
Run this to see the patterns of missing values that exist in the data and post the results:
proc mi data=logis nimpute=0;
var CKD EtOH agegrp2;
ods select MissPattern;
run;
Probably another variation of not knowing your data.
Your code in the log assumes AGEGRP has values of 50 or greater and then between 20 and 49.
72 if agegrp >= 50 then agegrp2 = 1; 73 else if agegrp >= 20 and agegrp <= 49 then agegrp2 = 0;
I bet that someone already reduced something of an age, or used a response to a question so that your AGEGRP variable is already categories of some sort and very likely to have many fewer values.
Run this and show us the result:
Proc freq data=logis; tables agegrp * agegrp2 / list missing; run;
Ran the proc freq and this is what it is showing me
@Dylannn3 wrote:
Ran the proc freq and this is what it is showing me
Which tells use that your Agegroup variable has already been collapsed to represent some range of ages and does not have any values greater than 1. You need to go to the source of the data to find out what 0 and 1 represent.Likely the 1 means in some specific range of ages and 0 all the other ages. But without documentation somewhere the range is unknown.
Or find an actual age variable somewhere (might have really different name) or possibly a variable containing date of birth and calculate an age at a given point in that that you can used to make your Agegrp2.
Hi thank you!!! you were correct the age group variable was collapsed. I was able to finish the rest of my analysis. Thank you once again for everyones help in this thread!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.