[R] covariate or predictor
Rolf Turner
r.turner at auckland.ac.nz
Wed Nov 26 03:13:02 CET 2014
On 26/11/14 13:57, Kristi Glover wrote:
> Hi,
> I am wondering how I can separate whether it is covariate or predictor in the ANOVA analysis. For example
> A<-structure(list(Machine = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
> 2L, 3L, 3L, 3L, 3L, 3L), Diameter = c(20L, 25L, 24L, 25L, 32L,
> 22L, 28L, 22L, 30L, 28L, 21L, 23L, 26L, 21L, 15L), Strength = c(36L,
> 41L, 39L, 42L, 49L, 40L, 48L, 39L, 45L, 44L, 35L, 37L, 42L, 34L,
> 32L)), .Names = c("Machine", "Diameter", "Strength"), class = "data.frame", row.names = c(NA,
> -15L))
> attach(A)
> b<-aov(Strength~Diameter)
> summary(b)
> c<-aov(Strength~Diameter+as.factor(Machine))
> summary(c)
> I am confused here whether the "Mechine" is covariate or predictor. How do I know which one is covariate and predictor?
> If Machine is predictor (just like Diameter), how I am supposed to write in the model?
> is the equation (below) for this one in the condition that the Machine is predictor?
> c1<-aov(Strength~Diameter+Machine), ?????. If it is so, it means that co-variate is dummy variable, right????
> Your help will really help me to clear the concept.
(1) Please don't post in HTML; messages with code in them become unreadable.
(2) This isn't really an R question is it? Possibly better posted to
stackexchange.
(3) What in your mind is the difference between "covariate" and
"predictor"? In my (possibly limited) understanding, the words are
synonymous.
(4) Are you perhaps concerned with the difference between a continuous
predictor and a categorical (factor) predictor?
(5) In your example "Machine" is pretty clearly *categorical*; the
numbers 1, 2, and 3 are just *labels* for the machines; their numerical
value is of no significance. The labels could just as well be "A", "B"
and "C", or "melvin", "irving" and "clyde".
(6) OTOH "Diameter" is pretty obviously interpretable as a *numerical*
measurement.
(7) I have no idea what you mean by "If it is so, it means that
co-variate is dummy variable, right????" Would you care to translate
that into English?
cheers,
Rolf Turner
--
Rolf Turner
Technical Editor ANZJS
More information about the R-help
mailing list