BookmarkSubscribeRSS Feed
KatieBachert23
Calcite | Level 5

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.

Screen Shot 2020-07-31 at 11.15.16 AM.png

 

11 REPLIES 11
PaigeMiller
Diamond | Level 26

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
KatieBachert23
Calcite | Level 5

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

PaigeMiller
Diamond | Level 26

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
KatieBachert23
Calcite | Level 5

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!

 

KatieBachert23
Calcite | Level 5

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?

Screen Shot 2020-08-04 at 1.51.26 PM.png

Screen Shot 2020-08-04 at 1.56.46 PM.png

PaigeMiller
Diamond | Level 26

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
KatieBachert23
Calcite | Level 5

There are 4 flocks total and each flock has 12 birds

KatieBachert23
Calcite | Level 5

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

PaigeMiller
Diamond | Level 26

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
KatieBachert23
Calcite | Level 5

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:

Screen Shot 2020-08-06 at 11.46.05 AM.png

KatieBachert23
Calcite | Level 5

Hopefully the context I sent is easy to read

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!

What is Bayesian Analysis?

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.

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
  • 11 replies
  • 1360 views
  • 1 like
  • 2 in conversation