Calcite | Level 5

Calculate overall differences

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.

11 REPLIES 11
Diamond | Level 26

Re: Calculate overall differences

Are you talking about differences of the means among the 5 time periods? Or something else? What does the word "overall" indicate here?

--
Paige Miller
Calcite | Level 5

Re: Calculate overall differences

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

Diamond | Level 26

Re: Calculate overall differences

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.

--
Paige Miller
Calcite | Level 5

Re: Calculate overall differences

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!

Calcite | Level 5

Re: Calculate overall differences

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?

Diamond | Level 26

Re: Calculate overall differences

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;``
--
Paige Miller
Calcite | Level 5

Re: Calculate overall differences

There are 4 flocks total and each flock has 12 birds

Calcite | Level 5

Re: Calculate overall differences

I did the ods graphic off; statement and it still won't run

Diamond | Level 26

Re: Calculate overall differences

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.

--
Paige Miller
Calcite | Level 5

Re: Calculate overall differences

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:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc glm data=mite_sen.percentofday;
NOTE: Variable Name Change. Time Period -> Time_Period
NOTE: Variable Name Change. Pecking Hz -> Pecking_Hz
NOTE: Variable Name Change. Preening Hz -> Preening_Hz
NOTE: Variable Name Change. Dustbathing Hz -> Dustbathing_Hz
NOTE: Variable Name Change. Shaking Hz -> Shaking_Hz
NOTE: Variable Name Change. Pecking s -> Pecking_s
NOTE: Variable Name Change. Preening s -> Preening_s
NOTE: Variable Name Change. Dustbathing s -> Dustbathing_s
NOTE: Variable Name Change. Shaking s -> Shaking_s
NOTE: Variable Name Change. Pecking PercentOfDay -> Pecking_PercentOfDay
NOTE: Variable Name Change. Preening PercentOfDay -> Preening_PercentOfDay
NOTE: Variable Name Change. Dustbathing PercentOfDay -> Dustbathing_PercentOfDay
NOTE: Variable Name Change. Shaking PercentOfDay -> Shaking_PercentOfDay
74 class time_period bird flock;
75 model pecking_s preening_s dustbathing_s shaking_s = time_period flock bird(flock) time_period*flock
75 ! time_period*bird(flock);
76 lsmeans time_period flock bird(flock) time_period*flock time_period*bird(flock)/lines tdiff;
77 run;

NOTE: The import data set has 1896 observations and 16 variables.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.
NOTE: Data label collision avoidance has been disabled because the threshold has been reached. You can set LABELMAX=3600 in the ODS
GRAPHICS statement to restore collision avoidance.

When I do the ods graphic off; the running icon keeps going:

Calcite | Level 5

Re: Calculate overall differences

Hopefully the context I sent is easy to read

Discussion stats
• 11 replies
• 1409 views
• 1 like
• 2 in conversation