search for: constrast

Displaying 20 results from an estimated 33 matches for "constrast".

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,
2010 Dec 14
0
defining contrasts in lm() - is there a simpler way?
...llowing: x$new[x$f1==1 & x$f2==1] <- 1 x$new[x$f1==1 & x$f2==2] <- 2 x$new[x$f1==1 & x$f2==3] <- 3 x$new[x$f1==2 & x$f2==1] <- 4 x$new[x$f1==2 & x$f2==2] <- 5 x$new[x$f1==2 & x$f2==3] <- 6 x$new <- as.factor(x$new) contrasts(x$new) <- cbind(" my constrast" = c( .5, -.5, 0, .5, 0, -.5)) summary(lm(y ~ new, x)) I have two questions concerning this: 1) if I take a look at the constrast matrix derived from the one contrast I specified, I assume that R automatically adds the missing constrasts so they are orthogonal. round(cor(attributes(x$n...
2013 Sep 13
1
Creating dummy vars with contrasts - why does the returned identity matrix contain all levels (and not n-1 levels) ?
Hello, I have a problem with creating an identity matrix for glmnet by using the contrasts function. I have a factor with 4 levels. When I create dummy variables I think there should be n-1 variables (in this case 3) - so that the contrasts would be against the baseline level. This is also what is written in the help file for 'contrasts'. The problem is that the function
2006 Aug 24
1
how to constrast with factorial experiment
Hello, R users, I have two factors (treat, section) anova design experiment where there are 3 replicates. The objective of the experiment is to test if there is significant difference of yield between top (section 9 to 11) and bottom (section 9 to 11) of the fruit tree under treatment. I found that there are interaction between two factors. I wonder if I can contrast means from levels of
2008 Jun 16
1
contrasts using adonis function
Hi, Somebody knows how to make contrasts if i'm using the function adonis? Thanks.
2009 Jun 11
1
standard error beta glm
...solve(t(model.matrix(fit))%*%model.matrix(fit)) ) Is posible calculate Std. Error for glm as lm, using cov(hat beta) = phi * solve(t(X) %*% hat W %*% X)^-1 on R? Who is hat W and phi output glm? y=rpois(20,4) fit.glm <- glm(y ~ x, family=poisson summary(fit.glm) Fitted to a model glm using constrast contr.sum and need compute the error standard for last level of the factor. best wishes for all, Ricardo. Veja quais s?o os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com
2008 Jul 14
1
Tissue specific genes by ANOVA?
...ts. Now I want to test if Heart is significant higher than Liver and Brain, or Liver is significant higher than Heart an Brain, ... I read about the pairwise.t.test, but I dont't want to test Heart against Liver and Heart against Brain, ... Is there any possibility to do that? ANOVA? Duncan? Constrasts? Please help -- View this message in context: http://www.nabble.com/Tissue-specific-genes-by-ANOVA--tp18441289p18441289.html Sent from the R help mailing list archive at Nabble.com.
2005 Aug 26
1
basic anova and t-test question
Hello, I'm posting this to receive some comments/hints about a rather statistical than R-technical question ... . In an anova of a lme factor SSPos11 shows up non-significant, but in the t-test of the summay 2 of the 4 levels (one for constrast) are significant. See below for some truncated output. I realize that the two test are different (F-test/t-test), but I'm looking for for a "meaning". Maye you have a schenario that explains how these differences can be created and how you'd go ahead and analyse it further. When...
2010 Oct 20
1
Please help: ANOVA with SS Type III for unequal sample sized data
...olete but I can not clarify it. I have a dataset from 23 males and 18 females. I measured one condition('cond') with 4 levels. So I'd like to see main effect of gender, cond and gender by cond interaction and also postHoc test. (In fact, I have to do anova 90 times) * 1. Question about constrast stuff for type III* After googling, I found a document ( https://stat.ethz.ch/pipermail/r-help/2001-October/015889.html) and it looked like make sense. This below is what I did on R and I encountered 'error message'. library(car) results_lmanova <- list() for(i in 1:90) {sum=subset(ast....
2007 Jul 06
1
maintaining specified factor contrasts when subsetting in lmer
...say time 3 is the base. This works fine. However, when I next use the subset argument to remove the last two time values, the output indicates that the specified contrast is not maintained (see below). I can solve this by creating a new dataframe for the subset of interest and redefining the constrasts, but I was wondering if there is a direct method that allows me to continue w/ the subset argument? (perhaps via supplying a contrast argument to lmer directly, but this doesn't seem possible based on the defintion of this argument in model.matrix.default). Thanks, Dave z <- rnorm(2...
2003 Feb 17
1
lda on curves
...example variable might be a directional component of angular momentum for a particular joint measured at a large number (101) of equally spaced timepoints. Each bowler generates a (fairly smooth) curve for each variable measured. I decided to represent each curve by a few orthogonal polynomial constrasts. There are 4 groups of bowlers corresponding to various speeds of delivery. I want to use canonical variant analysis to find linear combinations of my transformed variables discriminating well between the groups of bowlers. I used lda() from the MASS library to do this, but examining the outp...
2007 Jul 12
1
how to estimate treatment-interaction contrasts
Hello, R experts, Sorry for asking this question again again since I really want a help! I have a two-factor experiment data and like to calculate estimates of interation contrasts say factor A has levels of a1, a2, and B has levels of b1, b2, b3, b4, and b5 with 3 replicates. I am not sure the constrast estimate I got is right using the script below: score<-c(7.2,6.5,6.9,6.4,6.9,6.1,6.9,5.3,7.2,5.7,5.1,5.9,7.6,6.9,6.8, 7.2,6.6,6.9,6.4,6.0,6.0,6.9,6.9,6.4,7.5,7.7,7.0,8.6,8.8,8.3) A <- gl(2, 15, labels=c("a1", "a2")) B <- rep(gl(5, 3, labels=c("b1", "b2&...
2003 Jan 29
3
Analyzing an unbalanced AB/BA cross-over design
...11 13.9171 6.495e-05 *** Residuals 8254 11 The questions based on this output are 1) Why was there an error statement requesting type III SS based on lm ? 2) Why I got a result by using glm with 0 df for the period effect ? 3) How can I get the estimate, the StdError for the constrast (-1,1) of the treatment effect ? Thanks --
2000 May 02
3
Possible bug in factor (PR#531)
The expressions > x<-factor(x) and > class(x)<-"factor" behave differently when x is already an ordered factor. It may not be a bug but it caught me out when I was trying to remove the "orderedness" from a factor variable. The following R code illustrates the difference. Is this difference between the 2 commands desirable? > x<-1:3 > class(x) NULL
2006 Feb 16
0
SSQ decomposition and contrasts with ANOVA
...a2 vs (a1, a3) 1 ? ? ? ? a1 vs a3 1 ? ? ? ? -------------------------------------------------------- Residuals 18 23.090 1.283 -------------------------------------------------------- Or, In this case, how can I to test these constrasts? Thanks for any help, -- Jose Claudio Faria Brasil/Bahia/UESC/DCET Estatistica Experimental/Prof. Adjunto mails: joseclaudio.faria at terra.com.br joseclaudio.faria at oi.com.br jc_faria at uesc.br jc_faria at uol.com.br tel: 73-3634.2779
2007 Jul 03
0
how to calculate interaction contrast
Hello, R experts, Sorry for asking this question again since I really want a help! I have a two-factor experiment data and like to calculate estimates of interation contrasts say factor A has levels of a1, a2, and B has levels of b1, b2, b3, b4, and b5 with 3 replicates. I am not sure the constrast estimate I got is right using the script below: score<-c(7.2,6.5,6.9,6.4,6.9,6.1,6.9,5.3,7.2,5.7,5.1,5.9,7.6,6.9,6.8, 7.2,6.6,6.9,6.4,6.0,6.0,6.9,6.9,6.4,7.5,7.7,7.0,8.6,8.8,8.3) A <- gl(2, 15, labels=c("a1", "a2")) B <- rep(gl(5, 3, labels=c("b1", "b2&...
2006 Jul 28
0
tests performed by anova
Dear R-helpers, In the case of two categorical factors, say a and b, once I have fixed the constrasts, the model matrix is set according to these contrasts with "lm", and the t-tests for the significance of the parameters provided by "summary" indeed concern the comparison of the model with each submodel obtained by removing the corresponding column of the model matrix. So...
2007 Jun 20
0
how to calculate estimate of interation contrast in two-factor experiment
Hello, R experts, I have a two-factor experiment data and like to calculate estimates of interation contrasts say factor A has levels of a1, a2, and B has levels of b1, b2, b3, b4, and b5 with 3 replicates. I am not sure the constrast estimate I got is right using the script below: score<-c(7.2,6.5,6.9,6.4,6.9,6.1,6.9,5.3,7.2,5.7,5.1,5.9,7.6,6.9,6.8, 7.2,6.6,6.9,6.4,6.0,6.0,6.9,6.9,6.4,7.5,7.7,7.0,8.6,8.8,8.3) A <- gl(2, 15, labels=c("a1", "a2")) B <- rep(gl(5, 3, labels=c("b1", "b2&...
2007 Jun 22
0
interaction contrast
Hello, R experts, Sorry for asking this question again since I really want a help! I have a two-factor experiment data and like to calculate estimates of interation contrasts say factor A has levels of a1, a2, and B has levels of b1, b2, b3, b4, and b5 with 3 replicates. I am not sure the constrast estimate I got is right using the script below: score<-c(7.2,6.5,6.9,6.4,6.9,6.1,6.9,5.3,7.2,5.7,5.1,5.9,7.6,6.9,6.8, 7.2,6.6,6.9,6.4,6.0,6.0,6.9,6.9,6.4,7.5,7.7,7.0,8.6,8.8,8.3) A <- gl(2, 15, labels=c("a1", "a2")) B <- rep(gl(5, 3, labels=c("b1", "b2&...
2002 Oct 14
1
Post hoc Multiple comparison
Dear R-listers I'm a new R-user who needs some help with a test that I want to do. I have done a field experiment: four treatments (cont, x, y and xy) at three sites (A, B and C), the response is count data (0 - 15). I've done a Poisson regression: >glm(response~as.factor(treatment)*as.factor(site), family=quasipoisson, offset(max.response), data=dat) The "offset" is the