Displaying 20 results from an estimated 10000 matches similar to: "R vs SPSS contrasts"
2004 Jan 11
3
newbie question on contrasts and aov
I try to move from SPSS to R/S and am trying to reproduce the results of SPSS
in R. I calculated a one-way anova with "spk" as experimental factor and erp
as depended variable.
The result of the Anova are the same concearning the mean square, F and p
values. But I also wanted to caculate the contr.sdif(4) contrast on spk. The
results are completely different now. I hope anybody can
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
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
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a
procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE
regression commands in SPSS?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
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
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
2010 Aug 13
1
different outcomes of P values in SPSS and R
I have been using generalized linear models in SPSS 18, in order to build
models and to calculate the P values. When I was building models in Excel
(using the intercept and Bs from SPSS), I noticed that the graphs differed
from my expectations. When I ran the dataset again in R, I got totally
different outcomes for both the P values as well as the Bs and the
intercepts. The outcomes of R seem much
2012 May 19
3
anovas ss typeI vs typeIII
Hi all,
I have been struggling with ANOVAs on R. I am new to R, so I created a simple data frame, and I do some analyses on R just to learn R and then check them on SPSS to make sure that I am doing fine. Here is the problem that I've run into:
when we use the aov function, it uses SS Type I as default (on SPSS it is Type III). Then I used the Anova function under cars package using the
2001 Aug 31
2
contrasts in lm
I've been playing around with contrasts in lm by specifying the contrasts
argument. So, I want to specify a specific contrast to be tested
Say:
> y _ rnorm(100)
> x _ cut(rnorm(100, mean=y, sd=0.25),c(-3,-1.5,0,1.5,3))
> reg _ lm(y ~ x, contrasts=list(x=c(1,0,0,-1)))
> coef(reg)[2]
x1
-1.814101
I was surprised to see that I get a different estimate for the
2004 Dec 18
1
Sums of sq in car package Anova function
Hello R users,
I am trying to run a three factor ANOVA on a data set with unequal
sample sizes.
I fit the data to a 'lm' object and used the Anova function from the
'car' package with the 'type=III' option to get type III sums of
squares. I also set the contrast coding option to 'options(contrasts =
c("contr.sum", "contr.poly"))' as
2011 Jan 11
5
A question on dummy variable
Dear all, I would like to ask one question related to statistics, for
specifically on defining dummy variables. As of now, I have come across 3
different kind of dummy variables (assuming I am working with Seasonal
dummy, and number of season is 4):
> dummy1 <- diag(4)
> for(i in 1:3) dummy1 <- rbind(dummy1, diag(4))
> dummy1 <- dummy1[,-4]
>
> dummy2 <- dummy1
>
2009 Mar 01
1
SPSS repeated interaction contrast in R
dear all,
i'm trying to reproduce an spss-anova in R.
It is an 2x3x3 repeated measures desingn with repeated contrasts.
In R i've coded a contrast matrix for all factors and made a
split in the aov summary - but I can't get the repeated interaction contrasts.
The output from SPSS looks like this:
TaskSw * CongNow * CongBefore: SS df Mean Square F Sig.
1 vs. 2 1 vs. 2 1 vs. 2
2002 Oct 08
3
repeated measures help; disagreement with SPSS
Hi, all.
I have a simple design I'm comparing to output from SPSS.
the design is 1 repeated measure (session) and 1 between measure
(cond). my dependent measure is rl. here is the data I'm using (in a
data.frame):
mig <- data.frame(subj=factor(rep(subj,3)),
cond=factor(rep(cond,3)),
session=factor(c(rep(1,nsubj),rep(2,nsubj),rep(3,nsubj))),
2012 Mar 21
2
Type II and III sum of squares (R and SPSS)
To whom it may concern
I made some analysis with R using the command Anova. However, I found
some problmes with the output obtained by selecting type II o type III
sum of squares.
Briefly, I have to do a 2x3 mixed model anova, wherein the first factor
is a between factor and the second factor is a within factor. I use the
command Anova in the list below, because I want to obtain also the sum
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 Mar 01
5
Type-I v/s Type-III Sum-Of-Squares in ANOVA
Hello,
I believe the aov() function in R uses a "Type-I sum-of-squares" by
default as against "Type-III".
This is relevant for me because I am trying to understand ANOVA in R using
my knowledge of ANOVA in SPSS. I can only reproduce the results of an ANOVA
done using R through SPSS if I specify that SPSS uses a Type-I
sum-of-squares. (And yes, I know that when the sample
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 Dec 03
3
Checking for orthogonal contrasts
A common point made in discussion of contrasts, type I, II, III SS etc
is that for sensible comparisons one should use contrasts that are
'orthogonal in the row-basis of the model matrix' (to quote from
http://finzi.psych.upenn.edu/R/Rhelp02/archive/111550.html)
Question: How would one check, in R, that this is so for a particular
fitted linear model object?
Steve Ellison
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