I am working on this project and need to calculate "overall differences in time spent between periods" with the data I have. I have imported my excel workbook into SAS studio and was wondering what is the next step I should take. Here is a screenshot of what I am working with, there are 5 different time periods in the data set.
Are you talking about differences of the means among the 5 time periods? Or something else? What does the word "overall" indicate here?
I am referring to the overall difference of the mean from each of the behaviors (pecking, preening, dustbathing, and shaking) based on the 5 time periods. I want to see if there were differences in times spent per behavior per bird based on the time periods. And then I want to see if there were differences in times spent per behavior per flock as well.
Thank you
By bird:
proc glm data=have;
class time_period bird;
model pecking preening dustbathing shaking = time_period bird time_period*bird;
lsmeans time_period bird time_period*bird/lines tdiff;
run;
quit;
By flock and bird
proc glm data=have;
class time_period bird flock;
model pecking preening dustbathing shaking = time_period flock bird(flock) time_period*flock time_period*bird(flock);
lsmeans time_period flock bird(flock) time_period*flock time_period*bird(flock)/lines tdiff;
run;
quit;
Since the second analysis accounts for the effects of both bird and flock, I would simply do that analysis and not the analysis which doesn't use flock.
In either case, if you have an awful lot of birds, maybe this isn't the best way to go.
I put the code in and this was the outcome (see attachments). I see that I need to fix the data= part. How do I get the data I want to the data=_____? I then did proc glm data=mite_sen (which is the table I showed in my first post) and says that " ERROR: File WORK.MITE_SEN.DATA does not exist"
Thank you!
I figured out the data= and fixed the wording so the variable matched up. When I ran the code this came up...do you know what this means?
It's trying to do some plots, and it is having problems. How many different birds and flocks do you have?
You might want to try turning off the ODS GRAPHICS before you run PROC GLM, although certainly some of the plots can be helpful. Use this command
ods graphics off;
There are 4 flocks total and each flock has 12 birds
I did the ods graphic off; statement and it still won't run
What do you mean by "it still won't run"? What do you see? Can you show us the ENTIRE log for PROC GLM, including the code, NOTEs, WARNINGs and ERRORs? Please copy the log as text and then paste it into the window that appears when you click on the </> icon here. Do not show us the log as a screen capture.
Code:
options validvarname=v7;
libname mite_sen xlsx "/folders/myfolders/myfolders/UC Davis Thesis/Mite Sensor.xlsx";
run;
proc glm data=mite_sen.percentofday;
class time_period bird flock;
model pecking_s preening_s dustbathing_s shaking_s = time_period flock bird(flock) time_period*flock time_period*bird(flock);
lsmeans time_period flock bird(flock) time_period*flock time_period*bird(flock)/lines tdiff;
run;
quit;
Log:
When I do the ods graphic off; the running icon keeps going:
Hopefully the context I sent is easy to read
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.