Hi...I am new on SAS communties and I would appreciate help with following data set...I have set with about 14000 IDs regarding specific event that was monitored during 11 years (2010-2020; with different number of IDs per year, for example 1211 IDs in 2010, 1294 in 2011...1007 in 2015, 1105 in 2016,... ), per each ID I have also season, time of the day when event occured, which species was affected and how many individuals of species was affected or dead...something like this
ID YEAR season per year time of day species affected dead
1 2010 summer morning 1 0 1
2 2010 autumn day 2 1 1
...
1212 2011 spring night 3 5 0
1213 2011
...
2033 2012 winter morning 1 3 1
2034 2013 spring morning 2 0 1
...
3535 2014 autumn night 3 2 5
...
13353 2020 summer day 1 1 1
I would like test is there significant difference between number and/or frequency of affected and dead animals of different species per year, per season within year, per time of day within season...I would appreciate help and suggestions...thanks!
Not sure exactly what you are looking for as a result. It it something like this?
data have;
infile datalines dsd dlm='|' truncover;
input ID YEAR season:$6. time_of_day:$7. species affected dead;
datalines;
1|2010|spring|night|3|5|0
2|2010|summer|morning|1|0|1
3|2010|autumn|day|2|1|1
4|2010|winter|morning|1|3|1
5|2011|spring|morning|2|0|1
6|2011|autumn|night|3|2|5
7|2011|summer|day|1|1|1
8|2011|winter|morning|1|3|1
;
proc means data=have sum maxdec=0;
var species affected dead;
class year;
run;
proc means data=have sum maxdec=0;
var species affected dead;
class season;
run;
proc means data=have sum maxdec=0;
var species affected dead;
class time_of_day;
run;
YEAR | N Obs | Variable | Sum | ||||||
---|---|---|---|---|---|---|---|---|---|
2010 | 4 |
|
|
||||||
2011 | 4 |
|
|
season | N Obs | Variable | Sum | ||||||
---|---|---|---|---|---|---|---|---|---|
autumn | 2 |
|
|
||||||
spring | 2 |
|
|
||||||
summer | 2 |
|
|
||||||
winter | 2 |
|
|
time_of_day | N Obs | Variable | Sum | ||||||
---|---|---|---|---|---|---|---|---|---|
day | 2 |
|
|
||||||
morning | 4 |
|
|
||||||
night | 2 |
|
|
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.