Displaying 20 results from an estimated 4000 matches similar to: "Ordered factors , was: surrogate poisson models"
1999 May 04
1
surrogate poisson models
Dear R-help,
I'm applying the surrogate Poisson glm, by following Venables & Ripley (7.3
pp238-42).
>overall_cbind(expand.grid(treatment=c("Pema","control"),age=c("young","adult","old"),repair=c("excellent","good","poor")),Fr=c(8,0,7,1,2,0,2,7,1,4,7,1,
0,3,2,5,1,9))
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.
2005 Feb 23
1
model.matrix for a factor effect with no intercept
I was surprised by this (in R 2.0.1):
> a <- ordered(-1:1)
> a
[1] -1 0 1
Levels: -1 < 0 < 1
> model.matrix(~ a)
(Intercept) a.L a.Q
1 1 -7.071068e-01 0.4082483
2 1 -9.073800e-17 -0.8164966
3 1 7.071068e-01 0.4082483
attr(,"assign")
[1] 0 1 1
attr(,"contrasts")
attr(,"contrasts")$a
[1]
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
2007 Mar 20
1
Error in nlme with factors in R 2.4.1
Hi,
the following R lines work fine in R 2.4.0, but not in R 2.4.1 or any devel versions of R
2.5.0 (see below for details).
library(drc) # to load the dataset 'PestSci'
library(nlme)
## Setting starting values
sv <- c(0.43355869, 2.49963220, 0.05861799, 1.73290589, 0.38153146, 0.24316978)
## No error
m1 <-
nlme(SLOPE ~ c + (d-c)/(1+exp(b*(log(DOSE)-log(e)))),
fixed =
2000 Feb 08
2
Windows metafile
Running
R : Copyright 1999, The R Development Core Team
Version 0.90.1 (December 15, 1999)
on NT 4.0 gives me problems with:
win.metafile(file="./x.emf")
x <- 1:100/7
plot(x,cos(x),type="n")
lines(x,sin(x))
abline(v=0:15,h=-2:2/2,col=gray(0.8))
Only labels and titles on axes are in the file.
No axes or lines of any kind. (I look at the file by
inserting it in Word,
1999 Feb 25
1
HTML-documentaion on NT
Once you hae in stalled Guido's NT port of R it
is nice and easy to install the add-on packages too.
However, it would be nice to have links to the documentation
of the functions in all the packages from the "All Installed
Functions" html-page, and not have to go through each of
the packages.
Is there a utility somewhere to do this?
Bendix
\\\|///
2000 Jan 03
1
Rounding in date.mdy from library(date)
The date library contains a function date.mdy that converts a number
D to the date (month,date,year as a list) at D days after 1 Jan 1960.
This a convention that fits in with SASs.
The logic would be that the result was the date at D days after
1 Jan 1960 00:00:00 (which is a POINT in time as opposed to a date which
is an interval), so that any D with 2<=D<3 was rounded to 3 Jan 1960
and
2003 Feb 14
5
Translating lm.object to SQL, C, etc function
This is my first post to this list so I suppose a quick intro is in
order. I've been using SPLUS 2000 and R1.6.2 for just a couple of days,
and love S already. I'm reading MASS and also John Fox's book - both have
been very useful. My background in stat software was mainly SPSS (which
I've never much liked - thanks heavens I've found S!), and Perl is my
tool of choice for
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
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
2012 Oct 27
1
contr.sum() and contrast names
Hi!
I would like to suggest to make it possible, in one way or another, to
get meaningful contrast names when using contr.sum(). Currently, when
using contr.treatment(), one gets factor levels as contrast names; but
when using contr.sum(), contrasts are merely numbered, which is not
practical and can lead to mistakes (see code at the end of this
message).
This issue was discussed quickly in 2005
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
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
2007 May 17
1
model.matrix bug? Nested factor yields singular design matrix.
Hi all,
I believe this is a bug in the model.matrix function.
I'd like a second opinion before filing a bug report.
If I have a nested covariate B with multiple values for
just one level of A, I can not get a non-singular design
matrix out of model.matrix
> df <- data.frame(A = factor(c("a", "a", "x", "x"), levels = c("x",
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
2006 May 11
2
greco-latin square
Hi,
I am analyzing a repeated-measures Greco-Latin Square with the aov command.
I am using aov to calculate the MSs and then picking by hand the appropriate
neumerator and denominator terms for the F tests.
The data are the following:
responseFinger
mapping.code Subject.n index middle ring
little
----------------------------------------------------------------------------
1 1
2011 May 18
1
Need expert help with model.matrix
Dear experts:
Is it possible to create a new function based
on stats:::model.matrix.default so that an alternative factor coding is used
when the function is called instead of the default factor coding?
Basically, I'd like to reproduce the results in 'mat' below, without having
to explicitly specify my desired factor coding (identity matrices) in the
'contrasts.arg'.
dd
2001 Feb 08
2
Test for multiple contrasts?
Hello,
I've fitted a parametric survival model by
> survreg(Surv(Week, Cens) ~ C(Treatment, srmod.contr),
> data = poll.surv.wo3)
where srmod.contr is the following matrix of contrasts:
prep auto poll self home
[1,] 1 1 1.0000000 0.0 0
[2,] -1 0 0.0000000 0.0 0
[3,] 0 -1 0.0000000 0.0 0
[4,] 0 0 -0.3333333 1.0 0
[5,] 0 0
2005 Jul 13
1
Name for factor's levels with contr.sum
Good morning,
I used in R contr.sum for the contrast in a lme model:
> options(contrasts=c("contr.sum","contr.poly"))
> Septo5.lme<-lme(Septo~Variete+DateSemi,Data4.Iso,random=~1|LieuDit)
> intervals(Septo5.lme)$fixed
lower est. upper
(Intercept) 17.0644033 23.106110 29.147816
Variete1 9.5819873 17.335324 25.088661
Variete2 -3.3794907 6.816101 17.011692
Variete3