Thank you all for commenting on this, I truly appreciate the advice.  I
have tried to multiple points suggested,

#I have made certain that age is recognized as a factor
#making sure I run type 3 test
y=lme(distance~Sex*age, random=(~1|Subject), corr=corSymm(,~1|Subject),
data=dental)
library(car)
Anova(y, type=3)

Analysis of Deviance Table (Type III tests)

Response: distance
                Chisq Df Pr(>Chisq)
(Intercept) 1591.5536  1    < 2e-16 ***
Sex            3.5525  1    0.05946 .
age          101.5329  3    < 2e-16 ***
Sex:age        7.0847  3    0.06925 .

#However, this again doesn't match at all and doesn't provide DDF or F
values so I have no idea how replicable it is to the SAS output.

#gls instead of lme for proc mixed method
y2.1 <- gls(distance~Sex*age, corr=corSymm(form = ~1 | Subject),
               data=dental)
anova(y2.1)

Denom. DF: 100
            numDF  F-value p-value
(Intercept)     1 4052.048  <.0001
Sex             1    8.462  0.0045
age             3   39.022  <.0001
Sex:age         3    2.868  0.0403

#However, the DDF is much higher (100 instead of 25) and the p values are
all different.

Is there any further information I can provide that would help?  I know
there are issues with each type of analysis, but all I would like to do is
be able to run this kind of analysis on a data set where the answers are
'known'.  I would like to match up the ANOVA results as best as possible (I
realize identical may not be possible).  Is there any way to replicate the
'unstructured' and 'repeated' SAS code in the "Comparing the SAS GLM and
MIXED Procedures for Repeated Measures" by Wolfinger and Chang?  I don't
know if I can attach file to the main board but a google search will bring
it up immediately.

Regards,

Charles

On Wed, Jan 25, 2012 at 11:19 PM, John Maindonald <
john.maindonald@anu.edu.au> wrote:

> It is well to note that type III sums of squares are problematic.
> For testing the effects of a main effect, the null model is constraining
> the main effect in a manner that depends on the parameterisation.
>
> There are situations where it makes sense to fit interactions without
> main effects, and it is clear what constraint on the main effect is the
> relevant null (with an interaction between a factor and a variable,
> does one want all lines to go though the same point, or through
> perhaps the origin?), but that situation is unusual.  For lines that
> are separate or all through the one point, one does not need
> type III sums of squares.
>
> Analyses often or frequently have enough genuine complications
> worrying (unless it is blindingly obvious that one ought to worry
> about it) without the rarely relevant complication of attending to a
> type III sum of squares.
>
> I'd guess that SAS and lme are, effectively, making different
> assumptions about the intended generalisation.  They are
> clearly using different denominator degrees of freedom for F.
> As one is looking for consistency across the 27 different youths,
> SAS's denominator degrees of freedom for the interaction seem
> more or less right, pretty much equivalent to calculating slopes
> for females and slopes for males and using a t-test to compare
> them.  (Sure, in the analyses presented, age has been treated
> as a categorical variable, but the comment still applies.)
>
> John Maindonald             email: john.maindonald@anu.edu.au
> phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
> Centre for Mathematics & Its Applications, Room 1194,
> John Dedman Mathematical Sciences Building (Building 27)
> Australian National University, Canberra ACT 0200.
> http://www.maths.anu.edu.au/~johnm
>
> On 26/01/2012, at 1:54 PM, David Duffy wrote:
>
> > On Tue, 24 Jan 2012, Charles Determan Jr wrote:
> >
> >> Greetings,
> >>
> >> I have been working on R for some time now and I have begun the
> endeavor of
> >> trying to replicate some SAS code in R.  I have scoured the forums but
> >>
> > This is also the Orthodont dataset, distributed with nlme.
> >
> > As David Atkins pointed out, R defaults to Type I SS. so you would need
> to use, for example, the Anova() command from the car package.  The other
> thing is that the SAS F statistics are only approximate, depending on which
> covariance structure is chosen (perhaps John Maindonald or someone clever
> could comment), so SAS offers different possibilities for ddf eg
> >
> > http://www2.sas.com/proceedings/sugi26/p262-26.pdf
> >
> > while lme and lmer offer one or none.
> >
> > --
> > | David Duffy (MBBS PhD)                                         ,-_|\
> > | email: davidD@qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
> > | Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
> > | 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v
> >
> > _______________________________________________
> > R-sig-mixed-models@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>

	[[alternative HTML version deleted]]


