Displaying 20 results from an estimated 100 matches for "helmert".
2009 Nov 08
2
reference on contr.helmert and typo on its help page.
I'm wondering which textbook discussed the various contrast matrices
mentioned in the help page of 'contr.helmert'. Could somebody let me
know?
BTW, in R version 2.9.1, there is a typo on the help page of
'contr.helmert' ('cont.helmert' should be 'contr.helmert').
2004 Mar 03
1
Confusion about coxph and Helmert contrasts
Hi,
perhaps this is a stupid question, but i need some help about
Helmert contrasts in the Cox model.
I have a survival data frame with an unordered factor `group'
with levels 0 ... 5.
Calculating the Cox model with Helmert contrasts, i expected that
the first coefficient would be the same as if i had used treatment
contrasts, but this is not true.
I this a error...
2006 Aug 22
1
summary(lm ... conrasts=...)
..."A","B","C") of a factor X:
Y<-c(rnorm(mean=0,n=12),rnorm(mean=2,n=12),rnorm(mean=4,n=12))
X<-factor(c(rep("A",12),rep("B",12),rep("C",12)))
Then I do a summary(lm(Y~X)...) using first "Treatment" contrasts
and then "Helmert" contrasts. Here are the coefficient parts
of the results in each case:
summary(lm(Y~X,contrasts=list(X="contr.treatment")))
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.2303 0.3220 0.715 0.47944
XB 1.3057 0.4554 2.867 0...
2005 Apr 13
2
multinom and contrasts
Hi,
I found that using different contrasts (e.g.
contr.helmert vs. contr.treatment) will generate
different fitted probabilities from multinomial
logistic regression using multinom(); while the fitted
probabilities from binary logistic regression seem to
be the same. Why is that? and for multinomial logisitc
regression, what contrast should be used? I guess it...
2006 Sep 29
1
Helmert contrasts for repeated measures and split-plot expts
...a repeated-measures design, the other
a split-plot. In a standard ANOVA I have usually undertaken a
multiple-comparison test on a significant factor with e.g TukeyHSD, but as
I understand it such a test is inappropriate for repeated measures or
split-plot designs.
Is it therefore sensible to use Helmert contrasts for either of these
designs? Whilst not providing all the pairwise comparisons of TukeyHSD,
presumably the P-statistic for each Helmert contrast will indicate clearly
whether that contrast is significant and should be retained in the model.
(This seems to come with the disadvantage that...
2005 Jun 23
4
contrats hardcoded in aov()?
On 6/23/05, RenE J.V. Bertin <rjvbertin at gmail.com> wrote:
> Hello,
>
> I was just having a look at the aov function source code, and see that when the model used does not have an Error term, Helmert contrasts are imposed:
>
> if (is.null(indError)) {
> ...
> }
> else {
> opcons <- options("contrasts")
> options(contrasts = c("contr.helmert", "contr.poly"))
> on.exit(options(opcons))
> ...
>
>...
2009 Oct 27
0
anova interaction contrasts: crossing helmert and linear contrasts
...("6wks", "4wks", "2wks"))
dist <- rep(gl(4,n,labels=c("1mi","2mi","3mi","4mi")),3)
What I would like to do is test two interaction contrasts that cross linear
coefficients of the variable "dist" with the two sets of helmert contrasts of
the variable "train".
I have tried so many things I think are wrong I won't reproduce them all here.
Here is a representative example:
My code:
contrasts(dist) = c(-3, -1, 1, 3)
contrasts(train) = contr.helmert(3)
aov1 = aov(fatigue~dist*train)
summary(aov1, intercept...
2001 Jun 15
1
contrasts in lm and lme
...ted leaving out library(nlme) and replacing
> options(contrasts=c(factor="contr.SAS",ordered="contr.poly"))
with the following contrasts
> options(contrasts=c(factor="contr.treatment",ordered="contr.poly"))
> options(contrasts=c(factor="contr.helmert",ordered="contr.poly"))
> options(contrasts=c(factor="contr.sum",ordered="contr.poly"))
> library(MASS) # needed for the contrast contr.sdif
> options(contrasts=c(factor="contr.sdif",ordered="contr.poly"))
The results from anova were...
2005 Apr 23
2
ANOVA with both discreet and continuous variable
...with 2 independent variable, one (x1)
is continuous, the other (x2) is a categorical
variable with 2 levels. The dependent variable (y) is
continuous. When I run linear regression y~x1*x2, I
found that the p value for the continuous independent
variable x1 changes when different contrasts was used
(helmert vs. treatment), while the p values for the
categorical x2 and interaction are independent of the
contrasts used. Can anyone explain why? I guess the p
value for x1 is testing different hypothesis under
different contrasts? If the interaction is NOT
significant, what contrast should I use to test th...
2005 Aug 29
1
lme and ordering of terms
Dear R users,
When fitting a lme() object (from the nlme library), is it possible to
test interactions *before* main effects? As I understand, R
conventionally re-orders all terms such that highest-order interactions
come last - but I??d like to know if it??s possible (and sensible) to
change this ordering of terms.
I??ve tried the terms() command (from aov) but I don??t know if something
1997 May 06
1
R-beta: formula() and model formulae
Several bugs (no solutions, yet). These might be well known.
1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod)
then one does not get back the formula (one gets, Error: invalid formula)
2) if x is of mode numeric, then the model formula
mymod <- lm(y ~ x + x^2)
is not processed as S would do it. The model is fit ignoring the x^2 term,
however mymod$call includes the x^2 term.
1997 May 06
1
R-beta: formula() and model formulae
Several bugs (no solutions, yet). These might be well known.
1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod)
then one does not get back the formula (one gets, Error: invalid formula)
2) if x is of mode numeric, then the model formula
mymod <- lm(y ~ x + x^2)
is not processed as S would do it. The model is fit ignoring the x^2 term,
however mymod$call includes the x^2 term.
1998 May 29
0
aov design questions
...t the Error strata working.)
Q 2) If the speed is important, can we give up choice of contrasts used to
set up the dummy factor variables? ( contr.treatment, contr.sum)
Why do I ask?
In pursuit of speed (we're talking nanoseconds for a reasonable size
data set) I have forced in helmert contrasts because their
orthogonality makes it slick to compute. So in this version, whatever
option(contrasts) is set will be ignored.
I don't like making that choice for the user esp. since it gives wrong
answers under the default contrasts, and have thought about
converting...
2013 Feb 11
2
stringsAsFactors
...or variables which have only a few levels and will be used in modeling. Every
character variable of every dataset in "Statistical Models in S", which introduced
factors, is of this type so auto-transformation made a lot of sense. The "solder" data
set there is one for which Helmert contrasts are proper so guess what the default contrast
option was? (I think there are only a few data sets in the world for which Helmert makes
sense, however, and R eventually changed the default.)
For character variables that should not be factors such as a street adress
stringsAsFactors ca...
1999 Oct 22
1
factors in glm
Is there any logical reason why glm prints out the labels of factor
levels after variable names when baseline contrasts (contr.treatment)
are used but the codes for the levels when mean contrasts (contr.sum)
are used? Jim
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2005 Aug 15
1
error in predict glm (new levels cause problems)
Dear R-helpers,
I try to perform glm's with negative binomial distributed data.
So I use the MASS library and the commands:
model_1 = glm.nb(response ~ y1 + y2 + ...+ yi, data = data.frame)
and
predict(model_1, newdata = data.frame)
So far, I think everything should be ok.
But when I want to perform a glm with a subset of the data,
I run into an error message as soon as I want to predict
2000 Aug 01
1
Testing for parallel slopes
...In fact,
I get the same answers with the default parametrization and the
alternative). Since I'm only interested in the interaction term, is it
even necessary to change the structure of the model matrix, or will I get
the answer I need using the default contrast matrices (i.e.
"contr.helmert", "contr.poly")?
=====================
Dr. Marc R. Feldesman
Professor and Chairman
Anthropology Department
Portland State University
1721 SW Broadway
Portland, Oregon 97201
email: feldesmanm at pdx.edu
phone: 503-725-3081
fax: 503-725-3905
http://odin.cc.pdx.edu/~h1mf
=====...
2007 Oct 11
2
Type III sum of squares and appropriate contrasts
I am running a two-way anova with Type III sums of squares and would
like to be able to understand what the different SS mean when I use
different contrasts, e.g. treatment contrasts vs helmert contrasts. I
have read John Fox's "An R and S-Plus Companion to Applied Regression"
approach -p. 140- suggesting that treatment contrasts do not usually
result in meaningful results with Type III SS but it's not clear to me
why. Any suggestions on a stats text discussing this woul...
2006 Aug 16
0
confusing about contrasts concept [long]
..., it follows that an identification constraint
applies, namely v'phi = 0. By multiplying both sides by (C'C)^{-1} C',
it also follows that
*alpha =(C'C)^{-1}C'phi
which provides an interpretation for the alpha's in terms of the
(constrained) phi's. For example take the Helmert contrasts.
> contr.helmert(4)
[,1] [,2] [,3]
1 -1 -1 -1
2 1 -1 -1
3 0 2 -1
4 0 0 3
The constraint vector is clearly v= (1,1,1,1), since the columns add to
zero. In this case the columns are also mutually orthogonal, so the
matrix (C'C^{-l} C' (the generalized inverse of C) has a simila...
2008 Sep 26
1
Type I and Type III SS in anova
.../ running
Anova(model,type=c("III")). However summary(model) gives the same results in
both cases. Is this how it is set up?
> local({pkg <- select.list(sort(.packages(all.available = TRUE)))
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> options(contrasts=c("contr.helmert","contr.poly"))
> model2<-aov(tdrate~temp*sex)
> summary(model2)
Df Sum Sq Mean Sq F value Pr(>F)
temp 3 0.110137 0.036712 1005.6947 < 2e-16 ***
sex 1 0.000141 0.000141 3.8593 0.05095 .
temp:sex 3 0.000154 0.000051 1.407...