Displaying 20 results from an estimated 300 matches similar to: "drop1 with contr.treatment"
2010 Apr 24
1
Multiple Correlation coefficient (spearman, Kenall)
Hi,
I'm currently trying to find/define a relationship between one dependent and
several independant variables.
The problem is that i cannot use the normal multiple regression/correlation
in Spss because the data is not normal distributed.
i calculated the spearman roh and Kendalls tau Correlation and also some
partial correlations in R.
Now i wanna find out the the multiple correlation
2010 Oct 05
1
Tukey HSD Test als Post Hoc Test nach einem GLM inkl. Anova
Hallo,
zur Analyse von Daten zum Artenreichtum von Pflanzen, habe ich ein Glm (glm)
und anschlie?end eine Anova (anova) durchgef??hrt. Nun m??chte ich f??r die
signifikanten Einflussfaktoren einen Post Hoc Tukey Test durchf??hren, um zu
ermitteln in wie weit die einzelnen Faktorstufen sich signifikant
voneinander unterscheiden.
Mit dem Befehl (TukeyHSD) komme ich nicht
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').
2012 Oct 05
1
Setting the desired reference category with contr.sum
Hi,
I have 6 career types, represented as a factor in R, coded from 1 to 6. I
need to use the effect coding (also known as deviation coding) which is
normally done by contr.sum, e.g.
contrasts(career) <- contr.sum(6)
However, this results in the 6th category being the reference, that is being
coded as -1:
$contrasts
[,1] [,2] [,3] [,4] [,5]
1 1 0 0 0 0
2 0 1 0
2010 Feb 23
0
Name for factor's levels with contr.sum
Hi R-useRs,
after having read
http://tolstoy.newcastle.edu.au/R/help/05/07/8498.html
with the same topic but five years older. the solution for a contr.sum
with names for factor levels for R version 2.10.1 will be to comment out
the following line
#colnames(cont) <- NULL
in contr.sum i guess? by the way, with contrasts=FALSE colnames are set,
so i don't know what the aim is to avoid
2013 Apr 27
1
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
i am getting the following error
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
can any on e suggest how to rectify
[[alternative HTML version deleted]]
2002 Nov 25
1
Contr.poly for n > 100 (PR#2326)
Full_Name: David Clifford
Version: Version 1.5.1 (2002-06-17)
OS: Red Hat 7.3
Submission from: (NULL) (128.135.149.55)
For n values above 100 there appears to be a bug in contr.poly(n).
The contrast matrix should have rank n-1.
Running the code below gives output (ie errors) at n=98, 100
and every value greater than 102.
for(n in 2:150)
{
K <- contr.poly(n)
rnk <-
2008 May 20
1
contr.treatments query
Hi Folks,
I'm a bit puzzled by the following (example):
N<-factor(sample(c(1,2,3),1000,replace=TRUE))
unique(N)
# [1] 3 2 1
# Levels: 1 2 3
So far so good. Now:
contrasts(N)<-contr.treatment(3, base=1, contrasts=FALSE)
contrasts(N)
# 1 2
# 1 1 0
# 2 0 1
# 3 0 0
whereas:
contr.treatment(3, base=1, contrasts=FALSE)
# 1 2 3
# 1 1 0 0
# 2 0 1 0
# 3 0 0 1
contr.treatment(3, base=1,
2005 Mar 03
0
Baffled by drop1
I've been experimenting with drop1 for my biostatistics class, to obtain the
so-called Type III sums of squares. I am fully aware of the deficiencies of
this method, however I feel that the students should be familiar with it.
What I find baffling is that when applied to a fully balanced design, you
obtain different sums of squares. I've used this for several years in Splus
and R and never
2011 Mar 14
1
coxph and drop1
A recent question in r-help made me realize that I should add a drop1 method
for coxph and survreg. The default does not handle strata() or cluster()
properly.
However, for coxph the right options for the "test" argument would be
likelihood-ratio, score, and Wald; not chisq and F. All of them reference
a chi-square distribution. My thought is use these arguments, and add an
2005 Mar 03
0
Baffled by drop1: Please ignore previous request!
My apologies to the list for sending this without adequate research. I have
found my answer; please ignore! Thanks.
I've been experimenting with drop1 for my biostatistics class, to obtain the
so-called Type III sums of squares. I am fully aware of the deficiencies of
this method, however I feel that the students should be familiar with it.
What I find baffling is that when applied to a fully
2011 Feb 03
3
interpret significance from the contr.poly() function
Hello R-help
I don’t know how to interpret significance from the contr.poly() function . From
the example below
: how can I tell if data has a significant Linear/quadratic/cubic trend?
> contr.poly(4, c(1,2,4,8))
.L .Q .C
[1,] -0.51287764 0.5296271 -0.45436947
[2,] -0.32637668 -0.1059254 0.79514657
[3,] 0.04662524 -0.7679594 -0.39757328
[4,] 0.79262909
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
2010 Aug 29
2
glm prb (Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") : )
glm(A~B+C+D+E+F,family = binomial(link = "logit"),data=tre,na.action=na.omit)
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
contrasts can be applied only to factors with 2 or more levels
however,
glm(A~B+C+D+E,family = binomial(link = "logit"),data=tre,na.action=na.omit)
runs fine
glm(A~B+C+D+F,family = binomial(link =
2010 Mar 01
0
MASS::loglm - exploring a collection of models with add1, drop1
I'd like to fit and explore a collection of hierarchical loglinear
models that might
range from the independence model,
~ 1 + 2 + 3 + 4
to the saturated model,
~ 1 * 2 * 3 * 4
I can use add1 starting with a baseline model or drop1 starting with the
saturated model,
but I can't see how to get the model formulas or terms in each model as
a *list* that I can work with
further.
Consider
2005 Apr 23
1
question about about the drop1
the data is :
>table.8.3<-data.frame(expand.grid( marijuana=factor(c("Yes","No"),levels=c("No","Yes")), cigarette=factor(c("Yes","No"),levels=c("No","Yes")), alcohol=factor(c("Yes","No"),levels=c("No","Yes"))), count=c(911,538,44,456,3,43,2,279))
2010 Sep 15
1
contr.sum, model summaries and `missing' information
Hi,
I have a dataset with a response variable and multiple factors with more
than two levels, which I have been fitting using lm() or glm(). In
these fits, I am generally more interested in deviations from the global
mean than I am in comparing to a "control" group, so I use contr.sum()
as the factor contrasts. I think I'm happy to interpret the
coefficients in the model summary
2008 Aug 10
1
(Un-)intentional change in drop1() "Chisq" behaviour?
Dear List,
recently tried to reproduce the results of some custom model selection
function after updating R, which unfortunately failed. However, I
ultimately found the issue to be that testing with pchisq() in drop1()
seems to have changed. In the below example, earlier versions (e.g. R
2.4.1) produce a missing P-value for the variable x, while newer
versions (e.g. R 2.7.1) produce 0 (2.2e-16).
2009 Jan 23
1
Interpreting model matrix columns when using contr.sum
With the following example using contr.sum for both factors,
> dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way
> model.matrix(~ a * b, dd, contrasts = list(a="contr.sum", b="contr.sum"))
(Intercept) a1 a2 b1 b2 b3 a1:b1 a2:b1 a1:b2 a2:b2 a1:b3 a2:b3
1 1 1 0 1 0 0 1 0 0 0 0 0
2 1 1 0 0 1 0
2009 Apr 02
1
calculating drop1 R^2s
This is probably simple, but I just can't see it...
I want to calculate the R^2s for a series of linear models where each
term is dropped in turn. I can get the
RSS from drop1(), and the r.squared from summary() for a given model,
but don't know how to use the
result of drop1() to get the r.squared for each model with one term dropped.
Working example:
library(vcd) # for