Hi All,
I want to calculate the association within subjects. Each subject has left and right eye and they have a grade for the test is aval and the count for the times they have the grade each time they did the test is aval_count.
I tried to test the association by the following code and SAS didn't provide me the desired output.
I'm open to suggestions.
data have;
input usubjid :$20. aval alat $ aval_count;
datalines;
7751.000061 1.5 Left 3
7751.000061 1 Right 1
7751.000061 1.5 Right 2
7751.000824 1.5 Left 2
7751.000824 2 Left 1
7751.000824 1.5 Right 1
7751.000824 2 Right 2
7751.002940 1 Left 2
7751.002940 1.5 Left 1
7751.002940 1 Right 2
7751.002940 1.5 Right 1
7751.003306 1.5 Left 2
7751.003306 2 Left 1
7751.003306 1.5 Right 3
7751.003520 1.5 Left 3
7751.003520 1 Right 1
7751.003520 1.5 Right 2
7820.27252833 0 Left 3
7820.27252833 0 Right 3
7820.27253759 0 Left 3
7820.27253759 0 Right 3
7820.27253776 0 Left 3
7820.27253776 0 Right 3
7820.27265336 0 Left 3
7820.27265336 0 Right 3
7820.27270639 0 Left 3
7820.27270639 0 Right 2
7820.27270639 1 Right 1
7820.29087999 0 Left 3
7820.29087999 0 Right 3
7820.40672349 0 Left 3
7820.40672349 0 Right 3
7820.45921053 0 Left 3
7820.45921053 0 Right 3
7820.50956338 0 Left 3
7820.50956338 0 Right 3
7820.51799541 0 Left 1
7820.51799541 0 Right 1
7820.51968934 0 Left 2
7820.51968934 1 Left 1
7820.51968934 0 Right 2
7820.51968934 1 Right 1
run;
proc freq data=have;
tables USUBJID*ALAT*aval/ chisq measures;
weight aval_count;
run;
Thanks,
Mona
Your counts within levels of Usubjid as shown are pretty small for just about any purpose with 6 seeming to be the typical number of "grades". Splitting that by just about any other variable makes the cell counts so small to be almost meaningless.
I do find the structure of your Usubjid to be a tad odd. Typically most identification schemes don't go in for decimals. By any chance did you actually intend to this test using just the first 4 characters of the Usubjid value?
Please describe the "desired output" since it appears that you have some idea of what you wanted. Please not that Chi-squares don't like cells with 0 counts as you likely got in your output.
You might try using Usubjid as a BY variable and remove it from the Tables statement. That would at least reduce the number of 0 cell sizes but then you are going to have groups with only one value of Aval. Which isn't really going to be very testable.
aval 0, 1, 1.5 2 is a categorical variable.
aval count counts the number of each aval grades happen in each eye.
I want the test of association within eyes for each subject between all subjects.
Proc freq doesn't provide me any statistics when I use the proc freq the way I use it. Maybe there is a better way to get my desired outcomes.
test the association between eyes for each subject and for all subjects
I don't have a hypothesis I just want to know how they are correlated either using this procedure or other procedures.
Thanks
Hi Reeza,
I want to see the correlation between the subjects' scores between their eyes left and right.
this is a repeated measurement and aval record the grade of the test.
Not sure how to start as the data is a bit complicated.
Thanks,
Mona
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.