BookmarkSubscribeRSS Feed
Reeza
Super User

Here is what @FredrikE was referring to when he was asking for a data step:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

I suspect you're looking for a statstical analysis rather than just a calculation of the previous difference. 

 

First for an analysis you need to determine the type of analysis required, ie ANOVA, MANOVA, etc. 

Then you can program it. It sounds like you're still in the trying to determine how you should analyze your data. 

This question is less likely to be answered here since it's methodological question, rather than pure programming. You may get better responses on Cross Validated. 

 


@BorutK wrote:

Hi guys! 

 

I came across a problem with a small sample, where we did measure the amount of fat in goat's milk during 2 year experiment (YEAR), where we took samples continuosly 5 times (SAMPLING) each year from 2 different groups (TYPE) of goats. And now we need to know if there was some kind of difference between each sampling in each year? 

 

Can somebody help me with that?

 

Thank you,

 

Here is the data:  

DATE SAMPLING YEAR TYPE FAT
14.07.2015 1 1 EKO 2,44
14.07.2015 1 1 KON 2,53
12.08.2015 2 1 EKO 3,06
12.08.2015 2 1 KON 2,84
9.09.2015 3 1 EKO 3,19
9.09.2015 3 1 KON 3,14
7.10.1015 4 1 EKO 2,84
7.10.2015 4 1 KON 3,00
4.11.2015 5 1 EKO 3,15
4.11.2015 5 1 KON 3,18
8.06.2016 1 2 EKO 2,70
8.06.2016 1 2 KON 2,86
6.07.2016 2 2 EKO 2,85
6.07.2016 2 2 KON 2,61
1.08.2016 3 2 EKO 2,75
1.08.2016 3 2 KON 2,73
7.09.2016 4 2 EKO 2,92
7.09.2016 4 2 KON 2,90
5.10.2016 5 2 EKO 3,29
5.10.2016 5 2 KON 3,61

 

ballardw
Super User

You say "2 different groups (TYPE) of goats". Was there only one goat of each type? And what would the FAT variable represent? If it is the average of the goats in the group and there were more than one goat per type you might consider using the individual goat measurements instead of an average or group summary. That might help the sample size a bit.

BorutK
Fluorite | Level 6

We took a sample from each group of goats, so yes it the average of the group. I agree that it would be much easier if we would have individual measurements, but only have this.

ballardw
Super User

You might be able to include the number of goats in each sample group and indicate that value as a frequency variable, often with the FREQ statement. With a mean value that would have the procedure treat the data as N identical measures, changing the sample size though confidence limits could be somewhat restricted.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 18 replies
  • 3069 views
  • 2 likes
  • 4 in conversation