Hello
I am a beginner
My 2 independent variables are Cultivar and Block.
And then, I have multiple responses, 10 to be precise. Our responses are basically yield in the shape of fruit count and aggregate weight. The count and the weight was separated in 5 market categories: small, med, large, xlarge, and culls.
Ideally, I would like to test if block and/or cultivar had any effect on yield (given the 5 market categories, and within each market category we have fruit count and weight)
>data file attached
I am using SAS 9.4
Thank you!
See attached the code I have so far
Welcome to the SAS forum.
Please note that I've moved your post to the SAS/STATs forum instead, so hopefully, that gets you better responses.
It does help if you post your code and data directly into your posts, rather than attachments.
When you try and copy the code from a word document it doesn't always flow correctly, I get a wall of text instead of indented code.
See the code inserted below.
dm 'log; clear; output; clear; odsresults; clear'; options nocenter ls=90 ps=80 pageno=1; Data fall2018; input block cultivar$ SCount SWeight MCount MWeight LCount LWeight XCount XWeight CCount CWeight; datalines; 1 BHN589 0 0 15 3.9 30 10.65 46 25.54 25 7 2 BHN589 11 2.15 7 1.7 12 3.75 39 18.14 24 6.6 3 BHN589 9 1.85 10 2.8 23 7.55 39 18.94 15 2.8 1 Charger 13 2.6 9 2.2 33 10.5 51 26.78 28 6.75 2 Charger 13 2.4 20 5.1 22 7.25 33 16.91 26 7.8 3 Charger 10 1.8 26 6.4 18 6.05 51 25.55 11 3.24 1 GrandMarshall 7 1.3 13 3.25 37 12.3 40 21.52 13 4.84 2 GrandMarshall 10 1.7 19 4.2 29 9.6 54 27.6 15 4.3 3 GrandMarshall 14 2.5 16 4 23 7.5 32 13.35 9 1.95 1 Marnero 4 0.7 9 2.5 21 6.97 47 28.41 26 11.51 2 Marnero 2 0.3 4 0.89 30 9.05 53 27.08 33 14.54 3 Marnero 10 1.65 9 2.06 12 3.51 65 35.48 36 17.41 1 Rebelski 10 1.85 34 8.29 40 12.5 43 18.96 49 16.98 2 Rebelski 9 1.55 15 3.75 23 7 15 5.45 56 22.2 3 Rebelski 13 2.15 24 5.4 29 8.55 28 12.35 88 30.1 ; run; proc print data=fall2018; title2 'Organic Plots_raw data'; proc means data=fall2018 maxdec=2 n mean std; title2 'Summary Statistics by Treatment (cultivar)'; by cultivar; var SCount SWeight MCount MWeight LCount LWeight XCount XWeight CCount CWeight; proc means data=fall2018 mean stderr lclm uclm; class cultivar; var SCount; output out= fall20181 mean=mean lclm=lcl uclm=ucl stderr=ses; run; proc sgplot data=fall20181; title3 "Error Bars for Cultivar"; vbarparm category=cultivar response=mean / limitlower=lcl limitupper=ucl barwidth=.6; run; proc means data=fall2018 mean stderr lclm uclm; class cultivar; var SWeight; output out= fall20182 mean=mean lclm=lcl uclm=ucl stderr=ses; run; /*how to plot both Scount and Sweight in oneplot? */ proc sgplot data=fall20182; title4 "Error Bars for Cultivar"; vbarparm category=cultivar response=mean / limitlower=lcl limitupper=ucl barwidth=.6; run; PROC GLM data=fall2018; CLASS cultivar; MODEL Scount = cultivar; proc glimmix data=fall2018 plots=(residualpanel studentpanel boxplot(observed)); class block cultivar; model SCount = cultivar / dist=normal link=identity ddfm=kr; random block; lsmeans cultivar / cl lines adjust=tukey; output out=fall2018out pred=pred student=student lcl=lower ucl=upper; run; proc univariate data=fall2018out normal; var student; histogram / normal; qqplot / normal(mu=est sigma=est); run;
Thanks a lot Reeza!
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!
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.