BookmarkSubscribeRSS Feed
jtv
Calcite | Level 5 jtv
Calcite | Level 5

Hello,

 

I am looking for someone to help me out with some advice with the code for my project. My experiment is a split plot design with 4 replicates, my main plot are the treatments and my sub-plot are cultivars, over a period of 5 years.with 6 variables

 

I ran my code using Proc mixed for normality of variances for each variable and each year(loc). Is this code correct?

 

proc mixed data=f order=data plots=all;
 class loc rep cv trt;
 model lsds=trt cv trt*cv/ddfm=kr outp=ORP_data1 residual;
 random rep(trt) trt/solution;
 lsmeans cv trt trt*cv/ adjust=tukey;
 run;
proc plot data=ORP_data1;
plot resid*pred;
run;
proc univariate data=ORP_data1 normal plot;
var resid;
run;

 

 

Also , I want to know how do I get to combine the years for each variable and get to know if they can be combined (code).

And if it's better using proc glimmix.

 

I now that Levene can be use for this purpose but I think is not reliable for split-plot designs.

 

Thank you

 

 

 

5 REPLIES 5
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I would say that your code is not correct. At a minimum, you would not include "trt" in the RANDOM statement. Also, it is not clear how you want to deal with apparent repeated observations in 5 years. Currently, year is not included at all as a factor in your model.

 

In general, we would need more information to answer your questions. See the posting guidelines here:

 

https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133/jump-to/f...

 

For data that follow the normal distribution, MIXED and GLIMMIX will produce identical results. 

 

You'll need to more explicitly define what you mean by "combine the years". That phrase could mean different things, some of which could be acceptable ideas and some of which are not.

 

 

jtv
Calcite | Level 5 jtv
Calcite | Level 5

Thank you for your input.

 

Indeed I post and old code, my mistake.

 

My experiment was done for 5 years at the same location. But not in the same area or plants.

It was a randomized Split-plot design with the main plot =time and the sub-plot= cv and for each year it was measured the variable PE in each plot.

 

This is the code that I am using per year.

 

proc mixed data=xx order=data plots=all;
 class rep cv time;
 model pe=time cv time*cv/ddfm=satterth outp=ORP_data1 residual;
 random rep time*rep/solution;
 lsmeans cv time time*cv/ adjust=tukey;
 run;
proc plot data=ORP_data1;
plot resid*pred;
run;
proc univariate data=ORP_data1 normal plot;
var resid;
run;

 

not sure the code to determine the homogeneity of variances without using Levene test with GLM.

 

proc glm data=xx;
class time;
model pe=time/ss3;
means time /hovtest=levene (type=abs);
run;
proc glm data=xx;
class cv;
model pe=cv/ss3;
means cv /hovtest=levene (type=abs);
run;   

 

Also, after the single analysis per year. what I need to know is if the values of PE (variable measure each year) can be combined over the years  using either proc mixed or proc glimmix

 

I was using this code but not sure if it's right

 

proc mixed data=xx covtest plots=all;
  class rep loc cv time;
  model pe=  time | cv/dfm=satterth outp=file2 residual;
  random loc rep(loc) cv(loc) time(loc)/solution;
  lsmeans cv time cv*time/diff;

run;

 

I will really appreciate your help with these codes I am overwhelmed with the ammount of information thank you!

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Thank you for the additional information.

 

From what I can tell so far from your postings, you have 20 whole plots (WPs); four WPs are used in each of 5 years. Were the WPs randomly assigned to years as in a completely randomized design, or were the WPs spatially clustered in groups of 4 as in a randomized block design? In other words, what is the spatial layout of the WPs with respect to year assignment?

 

Within each whole plot, you have subplots which are randomly assigned to cultivars ("cv"), yes? How many subplots are in each whole plot, and how many cultivars do you have? Did you use the same cultivars in each year?

 

What is PE? What is it measured on?

 

Is "time" the same factor as "year"? What is "loc"? What is "rep"? Why do you think you have heterogeneous variances? I'm starting to suspect that your design is much more complicated than you've described so far....

 

I suggest that you post a full description of your experimental design, similar to a Methods section in a manuscript. A correct statistical model must mirror the experimental design. If we don't fully understand your design, we have no hope of providing correct answers to your questions.

 

It also would be very helpful to see the structure of your dataset. Please review the guidelines in the link I sent earlier, which includes the link to this paper

 

http://support.sas.com/resources/papers/proceedings12/189-2012.pdf

 

 

 

 

 

 

 

 

jtv
Calcite | Level 5 jtv
Calcite | Level 5
Hi thanks for your reply,

Every year the whole experiment was like this:

Rep1

Time3 time 5 ... time 0
Cv1cv2cv3 cv3cv2cv1 ... cv3cv1cv2

Rep2
Rep3
Rep4
Randomly assigned time and cv per rep


My main plot =time (5)
Sub-plot= Cv (3)
Replicates = rep (4)

Pe = measured in percentage

Loc = site year

I had a total of 60 measurements for my whole year.

And this was done for 5 years

Hope it's a little bit clear now.
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

It's a bit more clear, but we would still benefit from a more complete description, as I suggested previously. Without enough background information, it is possible to provide a correct answer to the wrong question. 

 

What is your research question about the effect of year? Why did you collect data in 5 years? Are you thinking of the five years as if they are a random sample from a statistical population of years to which you would like to make inference; i.e., is year a random effects factor? Or do you want to determine whether mean PE is a function of year; i.e., year is a fixed effects factor? My questions are pertinent to your question about how to "combine" years.

 

What is PE and on what is it measured? Is PE a destructive measurement (in other words, do you have to destroy the sampling unit to acquire the PE response)? Note that data on a percentage scale, which is bounded by 0 and 100, do not typically follow a normal distribution, and variance is not constant over the full range: variance approaches 0 as the mean percentage approaches 0% or 100% and is a maximum at 50%. Generalized linear (mixed) models offer alternative distributions for data on a proportion scale (percentage/100): either beta for proportions measured directly as proportions or binomial for proportions measured as a ratio of counts.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 5 replies
  • 2453 views
  • 0 likes
  • 2 in conversation