BookmarkSubscribeRSS Feed
hjong
Calcite | Level 5

Hello.

 

The following is the data that I want to analyze. The variables are Group, A and B. Basically, I want to find the mean of A and B in each group, divide A_mean by B_mean (= y), and compare the value of y between the groups (by Tukey for example). A and B are measured three times in all groups, except for B in Group 2. A and B are also independent. How should I write my SAS code?

 

Thank you.

 

16.573.14
16.773.09
16.713.14
220.279.37
220.2710.20
221.8210.14
2.10.44
2.9.83
2.9.69
2.9.37
321.3510.71
321.3410.74
321.6310.79
413.406.77
413.106.86
413.876.99
517.298.81
516.838.92
517.268.83
4 REPLIES 4
error_prone
Barite | Level 11
Please post the expected output and post the data you have as data-step.

Proc summary can create mean-values for each group.
hjong
Calcite | Level 5

Here's my SAS code. The problem with this code is that after dividing A_Mean by B_Mean, a single value of y for each group is obtained. As a result, I am not able to compare and test the significance of the the y's.

 

data data;
input Group A B;
datalines;
1	6.57	3.14
1	6.77	3.09
1	6.71	3.14
2	20.27	9.37
2	20.27	10.20
2	21.82	10.14
2	.		10.44
2	.		9.83
2	.		9.69
2	.		9.37
3	21.35	10.71
3	21.34	10.74
3	21.63	10.79
4	13.40	6.77
4	13.10	6.86
4	13.87	6.99
5	17.29	8.81
5	16.83	8.92
5	17.26	8.83
;
proc print;
run;

proc means;
class Group;
var A B;
output out=out mean= / autoname;
run;

proc print data=out;
run;

data new;
set out;
y=divide(A_Mean, B_Mean);
run;
proc print;
run;

proc glm data=new;
class Group;
model y=Group;
run;
error_prone
Barite | Level 11

Never used proc glm, but maybe removing the class statement solves the problem. 

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
  • 4 replies
  • 5322 views
  • 0 likes
  • 2 in conversation