Displaying 20 results from an estimated 10000 matches similar to: "Suggestion for 'contrasts' help page"
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")
>
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
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
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
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
2006 Sep 23
1
contrasts in aov
useRs,
A no doubt simple question, but I am baffled. Indeed, I think I
once knew the answer, but can't recover it. The default contrasts
for aov (and lm, and...) are contr.treatment and contr.poly for
unordered and ordered factors, respectively. But, how does one
invoke the latter? That is, in a data.frame, how does one indicate
that a factor is an *ordered* factor such that
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
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
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,
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.
2009 Dec 18
1
linear contrasts for trends in an anova
Hi everybody,
I'm trying to construct contrasts for an ANOVA to determine if there is a significant trend in the means of my groups.
In the following example, based on the type of 2x3 ANOVA I'm trying to perform, does the linear polynomial contrast generated by contr.poly allow me to test for a linear trend across groups?
doi=data.frame(
Group=c(
rep(1, 5), rep(2, 5), rep(3, 5),
2007 Feb 14
1
se.contrast confusion
Hello,
I've got what I'd expect to be a pretty simple issue: I fit an aov object
using multiple error strata, and would like some significance tests for the
contrasts I specified.
In this contrived example, I model some test score as the interaction of a
subject's gender and two emotion variables (angry, happy, neutral), measured
at entry to the experiment (entry) and later
2010 Sep 29
1
Understanding linear contrasts in Anova using R
#I am trying to understand how R fits models for contrasts in a
#simple one-way anova. This is an example, I am not stupid enough to want
#to simultaneously apply all of these contrasts to real data. With a few
#exceptions, the tests that I would compute by hand (or by other software)
#will give the same t or F statistics. It is the contrast estimates that
R produces
#that I can't seem to
2012 Jul 06
2
Anova Type II and Contrasts
the study design of the data I have to analyse is simple. There is 1 control group (CTRL) and 2 different treatment groups (TREAT_1 and TREAT_2).
The data also includes 2 covariates COV1 and COV2. I have been asked to check if there is a linear or quadratic treatment effect in the data.
I created a dummy data set to explain my situation:
df1 <- data.frame(
Observation =
2006 Aug 16
0
confusing about contrasts concept [long]
Tian
It appears the attachment might not have worked so I'll embed Bill's
message at the end.
Peter Alspach
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Peter Alspach
> Sent: Thursday, 17 August 2006 8:02 a.m.
> To: T Mu; R-Help
> Subject: Re: [R] confusing about contrasts concept
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
2008 Apr 29
0
Looking for Post-hoc tests (a la TukeyHSD) or interaction-level independent contrasts for survival analysis.
Hello all R-helpers,
I've performed an experiment to test for differential effects of
elevated temperatures on three different groups of corals. I'm
currently performing a cox proportional hazards regression with
censoring on the survivorship (days to mortality) of each individual
in the experiment with two factors: Temperature Treatment (2 levels:
ambient and elevated) and