0
votes
data _NULL_;

    input condition1 $ logcount1 condition2 $ logcount2 condition3 $ logcount3;

    datalines;

Plastic 7.66    Plastic 6.98    Plastic 7.80

Vacuum  5.26    Vacuum  5.44    Vacuum  5.80

Mixed   7.41    Mixed   7.41    Mixed   7.04

CO2  3.51   CO2  2.91   CO2  3.66

;

run;

proc print data=meat;

run;

I am required to find the mean and standard deviation of each line here and summarize them using PUT statements. I know how to use PUT statements but for the love of GOD I can't figure out how to get each mean and STD. I have tried putting avg = mean (of logcount1-logcount3) in multiple places but if I put it after datalines; I just get an error and if I put it before datalines I get weird output behavior.

1
What is the meat dataset, you're not creating a dataset with your first data step. Try putting the calculation after input and before datelines.Reeza
Don't completely change the content and meaning of a question. Post a new question instead.rob mayoff
Please stop trying to change the topic of your question from SAS to Objective-C, when your SAS question has already been answered. Just post a new question.rob mayoff
I am locking this. As @robmayoff notes, you may not edit the topic of a question like this. It's unfair to those who put in effort answering your question.Andrew Barber

1 Answers

1
votes
data _null_;
    input condition1 $ logcount1 condition2 $ logcount2 condition3 $ logcount3;
    avg=mean(logcount1, logcount2, logcount3);
    std=std(logcount1, logcount2, logcount3);
put avg std;
keep avg std;
datalines;
Plastic 7.66    Plastic 6.98    Plastic 7.80
Vacuum  5.26    Vacuum  5.44    Vacuum  5.80
Mixed   7.41    Mixed   7.41    Mixed   7.04
CO2  3.51   CO2  2.91   CO2  3.66
;

run;