Programming the statistical procedures from SAS

Limiting a data set and comparing subsamples in MIXED

Reply
N/A
Posts: 1

Limiting a data set and comparing subsamples in MIXED

1) Did I write this coding correctly?  I'm running a CRD with subsamples.  Fixed variables: Treatment and Rows(Treatment). Random variables Phenology.

2) I collected subsamples over three years but the years should not be pooled.  How can I ask SAS to analyze only one year without altering my data set by hand?

3) How can I ask SAS to compare each row within each treatment and phenology but not between them?  For example, I would like to compare 'Phenology Lvl 1, Trt Lvl 1, Row Lvl 1' vs. 'Phenology 1, Trt 1, Row 2' but I do not want to view 'Phenology 1, Trt 1, Row 1' vs. 'Phenology 2, Trt 2, Row 1.'

PROC MIXED DATA = Abundance3Year METHOD = TYPE3;

CLASS TREATMENT RowOrder PhenologyRef;

MODEL PairsRecovdRate = RowOrder(Treatment);

RANDOM PhenologyRef PhenologyRef*Treatment;

LSMEANS RowOrder(Treatment) / PDIFF;

RUN; QUIT;

Thanks for your help.

.

Respected Advisor
Posts: 2,655

Re: Limiting a data set and comparing subsamples in MIXED

1.  Ought to work.  I'm more used to the usual notation of A*B, rather than A(B) for the model and lsmeans statements, but they should work.  I am curious why you would use type3 analysis rather than the default REML with this design, though.

2.  A BY statement would give separate analyses by year.  Be sure the data are sorted appropriately.

3.  But phenology is a random effect, so if you want to do this, you will have to construct ESTIMATE statements to compare the BLUPs at each phenology.  This could become tedious.

Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 132 views
  • 0 likes
  • 2 in conversation