BookmarkSubscribeRSS Feed
ModernViking
Calcite | Level 5

So i am trying to research the mortality ratio in a population of wasp. My model runs as it should, but what command should i use if i  only wanted a clutch size of 5,10,15 to be displayed in the results section?

PROC SORT; BY Mating_status; RUN;
proc genmod data=WASP;
class Mating_status;
model Adult_males/Clutch_size = Clutch_size / dist = binomial
link = logit type3;
output out = values
pred = Pred
upper = upper
lower = lower;
by Mating_status;
run;
proc print data=values; run;

 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

A few things..

 

1) What do you mean when you say you want a "clutch size of 5,10,15 to be displayed in the results section"? Do you only want clutch sizes of 5, 10 and 15 to be part of your analysis? In that case use a simple WHERE Statement.

 

2) You use Mating_Status as a class variable, but you also use it in a BY Statement. This makes no sense, since when you use it in a by statement, your class variable will have only 1 level (which you can see in your output) and effectively be a continuous variable. So I'm guessing your code should look like this

 

proc genmod data=WASP;
    model Adult_males/Clutch_size = Clutch_size / dist = binomial
    link = logit type3;
    by Mating_status;
    output out = values pred = Pred lower = lower upper = upper;
run;
PeterClemmensen
Tourmaline | Level 20

Also, it is always a good idea to post your sample data as a data step. Like this

 

data WASP;
input Host_mass Clutch_size Adult_Males Adult_Females Brood_size Mating_status$;
datalines;
9 3 1 1 2 Mated
12 5 0 0 0 Mated
12 5 1 2 3 Mated
12 7 1 5 6 Mated
12 7 0 0 0 Virgin
12 8 1 5 6 Mated
12 9 5 0 5 Virgin
13 5 5 0 5 Virgin
13 5 0 0 0 Virgin
13 9 0 0 0 Virgin
14 1 0 0 0 Mated
14 3 0 0 0 Mated
14 3 0 0 0 Mated
14 5 4 0 4 Virgin
14 5 4 0 4 Virgin
14 5 5 0 5 Virgin
14 7 2 4 6 Mated
15 4 4 0 4 Virgin
15 5 5 0 5 Virgin
15 7 2 4 6 Mated
15 8 1 3 4 Mated
16 2 0 1 1 Mated
16 6 5 0 5 Virgin
17 4 0 4 4 Mated
17 5 1 4 5 Mated
17 10 4 0 4 Virgin
18 7 1 5 6 Mated
18 7 6 0 6 Virgin
18 8 7 0 7 Virgin
19 3 2 0 2 Virgin
19 6 4 0 4 Virgin
19 7 7 0 7 Virgin
20 7 0 4 4 Mated
20 7 6 0 6 Virgin
20 11 9 0 9 Virgin
21 6 0 0 0 Mated
21 7 1 5 6 Mated
21 8 8 0 8 Virgin
21 9 2 6 8 Mated
21 9 5 0 5 Virgin
22 4 4 0 4 Virgin
22 5 1 4 5 Mated
22 6 1 4 5 Mated
22 9 0 7 7 Mated
22 11 2 7 9 Mated
22 16 15 0 15 Virgin
23 9 1 5 6 Mated
23 10 1 9 10 Mated
24 3 0 0 0 Virgin
24 3 0 0 0 Virgin
24 6 3 0 3 Virgin
25 7 7 0 7 Virgin
25 8 8 0 8 Virgin
26 19 9 0 9 Virgin
27 7 2 2 4 Mated
28 8 8 0 8 Virgin
28 10 10 0 10 Virgin
28 15 14 0 14 Virgin
29 6 0 4 4 Mated
29 11 2 8 10 Mated
30 10 2 7 9 Mated
30 10 1 6 7 Mated
31 9 1 7 8 Mated
31 14 2 11 13 Mated
32 9 2 7 9 Mated
32 11 2 9 11 Mated
32 11 11 0 11 Virgin
32 11 11 0 11 Virgin
32 12 1 11 12 Mated
34 10 1 8 9 Mated
35 13 1 11 12 Mated
35 16 15 0 15 Virgin
36 10 2 8 10 Mated
36 16 16 0 16 Virgin
36 16 13 0 13 Virgin
37 11 2 8 10 Mated
37 15 13 0 13 Virgin
37 17 17 0 17 Virgin
38 10 2 8 10 Mated
38 15 15 0 15 Virgin
39 14 3 10 13 Mated
40 16 3 11 14 Mated
40 16 16 0 16 Virgin
40 16 13 0 13 Virgin
41 13 2 11 13 Mated
42 13 11 0 11 Virgin
44 12 1 11 12 Mated
44 12 12 0 12 Virgin
44 13 2 10 12 Mated
44 13 2 10 12 Mated
45 12 2 9 11 Mated
45 15 2 11 13 Mated
46 14 4 9 13 Mated
46 14 3 11 14 Mated
47 11 2 8 10 Mated
47 15 1 14 15 Mated
48 14 14 0 14 Virgin
49 13 12 0 12 Virgin
50 14 14 0 14 Virgin
52 16 2 14 16 Mated
58 17 16 0 16 Virgin
;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1149 views
  • 0 likes
  • 2 in conversation