Displaying 20 results from an estimated 7000 matches similar to: "se.contrast confusion"
2007 Oct 09
2
fit.contrast and interaction terms
Dear R-users,
I want to fit a linear model with Y as response variable and X a categorical variable (with 4 categories), with the aim of comparing the basal category of X (category=1) with category 4. Unfortunately, there is another categorical variable with 2 categories which interact with x and I have to include it, so my model is s "reg3: Y=x*x3". Using fit.contrast to make the
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 in reasoning, or is it
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's
helmert?
here is an example
2010 Apr 21
5
Bugs? when dealing with contrasts
R version 2.10.1 (2009-12-14)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with
2010 Jun 11
0
passing constrasts=FALSE to contrast functions -- why does this exist?
Hello,
I've noticed that all contrast functions, like contr.treatment,
contr.poly, etc., take a logical argument called 'contrasts'. The
default is TRUE, in which case they do their normal thing of returning
a n x n-1 matrix whose columns are linearly-independent of the
intercept.
If contrasts=FALSE, they instead return an n x n matrix with full rank
(usually the identity matrix,
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL.
Using the data bp.dat which accompanies
Helen Brown and Robin Prescott
1999 Applied Mixed Models in Medicine. Statistics in Practice.
John Wiley & Sons, Inc., New York, NY, USA
which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened
and initialized with
> dat <- read.table("bp.dat")
>
2008 Aug 26
2
options("contrasts")
Code:
> options("contrasts")
$contrasts
factor ordered
"contr.treatment" "contr.poly"
I want to change the first entry ONLY, without retyping "contr.poly". How do
I do it? I have tried various possibilities and cannot get anything to work.
I found out that the response to options("contrasts") has class
2006 Aug 17
1
Setting contrasts for polr() to get same result of SAS
Hi all,
I am trying to do a ordered probit regression using polr(), replicating a
result from SAS.
>polr(y ~ x, dat, method='probit')
suppose the model is y ~ x, where y is a factor with 3 levels and x is a
factor with 5 levels,
To get coefficients, SAS by default use the last level as reference, R by
default use the first level (correct me if I was wrong),
The result I got is a
2002 May 30
0
se.contrast: matrix contrast.obj doesn't work as documented (PR#1613)
The man page for se.contrast, when describing the contrast.obj
parameter, states that "Multiple contrasts should be specified
by a matrix as returned by contrasts."
When doing an unbalanced single factor ANOVA, using a contrast.obj
as returned by contrasts results in the following error from
qr.qty when se.contrast is called:
Error in qr.qty(object$qr, contrast) : qr and y must have
2010 Sep 23
2
Contraste polinomial con dos factores con niveles no equidistantes
Hola compañeros de la lista, qué tal.
Los molesto con la siguiente duda: Tengo un experimento con dos
factores A y B, cada uno de los cuales tiene los siguientes niveles (que
son concentraciones de dos hormonas vegetales aplicadas a plantas):
niveles del factor A: 0, 0.2, 0.5, 1
niveles del factor B: 0, 0.1, 0.2, 0.5, 1
y mi variable de respuesta es continua, todo dentro del set de datos
2003 Oct 08
1
Contrast specified with C() - R vs S-Plus problem
Hi,
For a n-level factor, I'd like to specify the first contrast and have
the remaining n-2 constructed automatically so that the set is
orthogonal. I then test the contrasts with summary.lm(anova-object).
In S-Plus, the following works:
>y.anova <- aov( y ~ C(CO2,c(1,0,-1)) )
>summary.lm(y.anova)
In R, it fails with the following error:
>levels(CO2)
[1]
2009 May 04
1
how to change nlme() contrast parametrization?
How to set the nlme() function to return the answer without the intercept parametrization?
#=========================================================================================
library(nlme)
Soybean[1:3, ]
(fm1Soy.lis <- nlsList(weight ~ SSlogis(Time, Asym, xmid, scal),
data = Soybean))
(fm1Soy.nlme <- nlme(fm1Soy.lis))
fm2Soy.nlme <- update(fm1Soy.nlme,
2011 May 11
1
Help with contrasts
Hi,
I need to build a function to generate one column for each level of a factor
in the model matrix created on an arbitrary formula (instead of using the
available contrasts options such as contr.treatment, contr.SAS, etc).
My approach to this was first to use the built-in function for
contr.treatment but changing the default value of the contrasts argument to
FALSE (I named this function
2008 Nov 10
1
question about contrast in R for multi-factor linear regression models?
Hi all,
I am using "lm" to fit some anova factor models with interactions.
The default setting for my unordered factors is "treatment". I
understand the resultant "lm" coefficients for one factors, but when
it comes to the interaction term, I got confused.
> options()$contrasts
unordered ordered
"contr.treatment"
2003 Jan 16
2
polynomial contrasts in R
In S-Plus, I can obtain polynomial contrasts for an ordered factor with
contr.poly(). The function also exists in R, however is limited to factors
where the levels are equally spaced. In S-Plus, one can obtain the contrasts
for a set of numeric values representing unequally spaced ordered factors.
Has anyone implemented this in R? I see that the S-Plus function calls
another function (poly.raw())
2007 Jan 08
2
Contrasts for ordered factors
Dear all,
I do not seem to grasp how contrasts are set for ordered factors. Perhaps someone can elighten me?
When I work with ordered factors, I would often like to be able to reduce the used polynomial to a simpler one (where possible). Thus, I would like to explicetly code the polynomial but ideally, the intial model (thus, the full polynomial) would be identical to one with an ordered factor.
2010 Oct 12
0
general construction of 'all pairwise comparison' contrast in ANOVA
Hi R people
I am using regsubsets() to fit large numbers of models and collect summary statistics in order to perform a Bayesian analysis of multi-way ANOVA with specific prior information. In general the variables have differing numbers of levels >=2. This works well but with variable of more than 2 levels there are naturally some arbitrary decisions about which treatment contrasts to
2002 Nov 07
4
Preferable contrasts?
Dear all,
I'm working with Cox-regression, because data could be censored.
But in this particular case not.
Now I have a simple example: PRO and PRE are (0,1) coded.
The response is not normal distributed.
We are interested in a model which could describe interaction.
But my results are depending strongly in the choose of the contrast option.
It is clear that there is some dependence in
2002 Dec 01
1
generating contrast names
Dear R-devel list members,
I'd like to suggest a more flexible procedure for generating contrast
names. I apologise for a relatively long message -- I want my proposal to
be clear.
I've never liked the current approach. For example, the names generated by
contr.treatment paste factor to level names with no separation between the
two; contr.sum simply numbers contrasts (I recall an
2003 Jun 26
1
Correct contrast for unreplicated 2K factorial design
Hi all,
I have been trying to reproduce an analysis from Douglas Montgomery?s
book on design and analysis of experiments. Table 6.10 of example 6.2 on
page 246, gives a table as follows:
> NPK <- expand.grid(A=mp,B=mp,C=mp,D=mp)
> Rate <- c(45,71,48,65,68,60,80,65,43,100,45,104,75,86,70,96)
> filtration <- cbind(NPK,Rate)
> filtration
A B C D Rate
1 - - - - 45
2