search for: linfct

Displaying 20 results from an estimated 135 matches for "linfct".

Did you mean: linbit
2012 Jun 22
0
R: Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!
Hello everybody, problem solved, there was a typo. I wrote Type instead of Material Best ----Messaggio originale---- Da: angelo.arcadi@virgilio.it Data: 22-giu-2012 11.05 A: <r-help@r-project.org> Ogg: Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'! Dear list members, I get the following error when using the glht function to perform a post hoc analysis for an ANOVA with repeated measures: require(nlme) lme_H2H_musician...
2012 Jun 22
0
Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!
Dear list members, I get the following error when using the glht function to perform a post hoc analysis for an ANOVA with repeated measures: require(nlme) lme_H2H_musicians = lme(H2H ~ Emotion*Material, data=musicians, random = ~1|Subject) require(multcomp) summary(glht(lme_H2H_musicians, linfct=mcp(Type = "Tukey")), test = adjusted(type = "bonferroni")) Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'! I donĀ“t understand why I get this error, but at the same ti...
2010 May 17
1
Query on linear mixed model
...Data,Attribute=="ChromaL") tapply(data$value, list(Product=data$Product), mean, na.rm=TRUE) model <- lme(value ~ Product+Time+Arm+Product*Arm+Product*Time+Product*Arm*Time, random = ~1 | Subj,data =data) summary(model) x<-anova(model) x library(multcomp) su<-summary(glht(model,linfct=mcp(Product="Tukey"))) ##length(su) ##su[1:(length(su)-4)] x11() plot(summary(glht(model,linfct=mcp(Product="Tukey"))),cex.axis=0.6) ##For Each Product Comparison across All Time Points. data<-MyData data<-subset(data,Product=="a") tapply(data$value, list(Time=...
2013 Jul 25
1
lme (weights) and glht
...odel? Thanks Sibylle --> works fine ME$Diversity=factor(ME$Diversity) H08_lme<-lme(log(Height2005_mean)~Diversity, data=ME, random=~1|Plot/ SubPlot, na.action=na.omit, subset=ME$Species=="Pse_men", method="ML") summary(H08_lme) anova(H08_lme) g_H08_lme<-glht(H08_lme, linfct=mcp(Diversity="Tukey")) print(summary(g_H08_lme)) --> using lme with weights I changed the order of factor() and introduced as.factor in the model H08_lme<-lme(log(Height2008_mean)~as.factor(Diversity), data=ME, random=~1|Plot/SubPlot, weights=varPower(form=~Diversity), na.a...
2011 Mar 01
1
glht() used with coxph()
...rv(stop, status > 0) ~ treatment, data = bladder1) coef exp(coef) se(coef) z p treatmentpyridoxine -0.063 0.939 0.161 -0.391 0.70 treatmentthiotepa -0.159 0.853 0.168 -0.947 0.34 Likelihood ratio test=0.91 on 2 df, p=0.635 n= 294 > glht(fit,linfct=mcp(treatment='Tukey')) General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Linear Hypotheses: Estimate pyridoxine - placebo == 0 -0.06303 thiotepa - placebo == 0 -0.15885 thiotepa - pyridoxine == 0 -0.09582 However, once I a...
2007 Nov 07
1
bug in multcomp?
...The lm statement runs fine, but for the glht command I get the following error. I noted that someone else asked the same question a while back but received no reply. I am hoping someone might know what is happening. anovaf2<-lm(achiev ~ major, data=data_mcp) > pairwise<- glht(anovaf2,linfct = mcp(major = "tukey")) Error in mcp2matrix(model, linfct = linfct) : Factor(s) major have been specified in 'linfct' but cannot be found in 'model'! Any help would be much appreciated. Rob. -- Robert A. Cribbie, PhD Department of Psychology York University...
2012 Jun 13
1
Tukey Kramer with ANOVA (glm)
...ppropriate pairwise comparison analysis and I cannot get the code to work with my data. I am *unclear how to code it to work with the interaction*; however, even when I attempt to use it only for a single factor, it does not work (see below). x<-aov(glm(Cucs_m~as.factor(BA),data=cuc)) glht(x, linfct=mcp(BA="Tukey")) .................................... Error in mcp2matrix(model, linfct = linfct) : Variable(s) ?BA? have been specified in ?linfct? but cannot be found in ?model?! Can anyone off suggestions on potential problems with my approach and/or script issues? Thank you very...
2010 Jul 21
1
post hoc test for lme using glht ?
...ulation were re-measured each week) > anova(model.3) numDF denDF F-value p-value (Intercept) 1 592 649.7753 <.0001 Week 5 592 302.9706 <.0001 Pop 1 222 70.7268 <.0001 Week:Pop 5 592 36.8576 <.0001 > summary(glht(model.3, linfct=mcp(Wk = "Tukey"))) Error in mcp2matrix(model, linfct = linfct) : Variable(s) ?Wk? of class ?integer? is/are not contained as a factor in ?model?. > is.factor(Wk) [1] FALSE > Week<-factor(Wk) > is.factor(Week) [1] TRUE > model.3<-lme(fixed=Totnum~Week*Pop, random=~1|n...
2011 Mar 04
2
glht: Problem with symbolic contrast for factors with number-levels
...'number' levels #B similar factor with 'letter' levels dat<-data.frame(y=1:4,A=factor(c(1,1,2,2)), B=factor(c('e','e','f','f')) ) motA<-lm(y~A,data=dat) motB<-lm(y~B,data=dat) library(multcomp) #does not work glht(motA,linfct=mcp(A=c("2 - 1 = 0 "))) #the error message is # Error in coefs(ex[[3]]) : # cannot interpret expression '1' as linear function #works glht(motB,linfct=mcp(B=c("f - e = 0"))) regards Ulrich Halekoh Aarhus University e-mail: Ulrich.Halekoh at agrsci.dk I use R.2.1...
2007 Mar 30
2
ANOVA and confidence intervals plot
Dear *, I would like to obtain for each factor of my anova model the "response variable vs factor" plot with means and 95% Tukey HSD intervals. I would appreciate any information on how to do that. Cheers -------------------------------------------------------------------- Max MANFRIN Tel.: +32 (0)2 650 3168 IRIDIA - CoDE, CP 194/6
2011 Jul 16
1
Creating composite factor and changing format from character to factor
...A linear model run on the updated dataframe works but notes that it coerces "SitePos" from character to factor e.g. Model.G = lmer(log10(SrCa) ~ SitePos + (1 | Eel), data = Data1) . The next step of a multiple comparison test on the output of the linear model: Model.G.mct = glht(Model.G, linfct = mcp(SitePos = "Tukey")) fails because the mct does not recognize "SitePos" as a factor and gives error message: "Error in mcp2matrix (model, linfct = linfct): Variable(s) 'SitePos' of class 'character' is/are not contained as a factor in 'model'....
2012 Jan 11
2
problems with glht for ancova
...*** edadysexo:log(lcc) 2 0.063 0.0317 1.6021 0.2025 Residuals 509 10.085 0.0198 Then, I tried to do a post-hoc using glht from multcomp package, but, because the interaction it's not siginificant i did it just for the factor > summary(glht(ancova, linfct=mcp(edadysexo="Tukey"))) Simultaneous Tests for General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Fit: aov(formula = log(peso) ~ edadysexo * log(lcc)) Linear Hypotheses: Estimate Std. Error t value Pr(>|t|) M - H == 0 -1.8218 1.1...
2011 Jul 18
1
Multiple comparison test on selected contrasts
...omp? I am running R 2.13.0 under Windows 7. The following linear model and mct produces a global mct of 15 paired contrasts of the combined (Site, Position) factor SitePos of which only 9 are of interest. Model.G = lmer(log10(SrCa) ~ SitePos + (1 | Eel), data = Data1) Model.G.mct = glht(Model.G, linfct = mcp(SitePos = "Tukey"))summary (Model.G.mct) The following code creates the desired reduced set of contrasts but I have been unable to apply it correctly to the mct. contr = rbind("CR core - MH core" = c(1,0,0,-1,0,0),"CR core - CR edge" = c(1,0,-1,0,0,0), "C...
2010 Nov 17
1
lme weights glht
Dear R-user I used lme to fit a linear mixed model inlcuding weights=varPower(). Additionally I wanted to use glht to calculate Tukey-Kramer multiple comparision. error: > glht(modelF, linfct=mcp(Species="Tukey")) Error in glht.matrix(model = list(modelStruct = list(reStruct = list(SubPlot = -0.305856275920955, : ?ncol(linfct)? is not equal to ?length(coef(model))? > glht(modelF, linfct=mcp(Diversity="Tukey")) Error in mcp2matrix(model, linfct = linfct) :...
2010 Aug 30
1
Help With Post-hoc Testing
...t;- lme(soi ~ solution + iobs, random = ~1 | iobs/solution, data = stack) > anova(Lmes.mod) numDF denDF F-value p-value (Intercept) 1 2383 2894.8342 <.0001 solution 1 2383 0.0003 0.9870 iobs 1 147 0.0126 0.9109 > summary(glht(Lmes.mod, linfct=mcp(solution="Tukey"))) Error in mcp2matrix(model, linfct = linfct) : Variable(s) ''solution'' of class ''numeric'' is/are not contained as a factor in ''model''. > I don''t understand the error since "solution"...
2012 Feb 12
2
ANCOVA post-hoc test
...dist 1 0.51291 0.51291 92.6908 5.703e-12 *** sampling:dist 3 0.05112 0.01704 3.0792 0.03822 * Residuals 40 0.22134 0.00553 Because there exist significantly different regression slopes, I did a post hoc test with glht() to find out between which samplings: >summary(glht(mod, linfct=mcp(sampling="Tukey"))) The results seem to say that there are no significantly different slopes for any of the pair-wise comparisons of factor levels: Simultaneous Tests for General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Fit: aov(formula = h ~ sampling *...
2009 Mar 22
1
Multiple Comparisons for (multicomp - glht) for glm negative binomial (glm.nb)
...$semio2)<-c("A","B","C","D") semiochemical$CO22<-factor(semiochemical$CO2) levels(semiochemical$CO22)<-c("1","2") model1<-glm.nb(total ~ semio + CO2 + location + temp + mean.wind.speed) model.glht.Semio <- glht(model1, linfct=mcp(semio="Tukey")) model.glht.CO2 <- glht(model1, linfct=mcp(CO2="Tukey")) [[alternative HTML version deleted]]
2011 Jul 26
3
a question about glht function
Hi all: There's a question about glht function. My data:data_ori,which inclue CD4, GROUP,time. f_GROUP<-factor(data_ori$GROUP) f_GROUP is a factor of 3 levels(0,1,2,3) result <- lme(sqrt(CD4) ~ f_GROUP*time ,random = ~time|ID,data=data_ori) glht(result, linfct = mcp(f_GROUP="Tukey") ) Error in `[.data.frame`(mf, nhypo[checknm]) : undefined columns selected I can't find out the reason for Error. Any help from you are welcome. Many thanks! [[alternative HTML version deleted]]
2007 Feb 09
1
Help in using multcomp.
...row=5, ncol=9) f <- gl(3,3,9, label=c("C", "Tl", "T2")) aof <- function(x) { m <- data.frame(f, x); aov(x ~ f, m) } amod <- apply(dat,1,aof) Now, how can I use 'glht' for the above amod. I know that I cannot use simply glht(amod, linfct = mcp(f = "Dunnett")). Also, if I want to use Dunnett for comparing C vs (T1 and T2), how can I specify this in the glht function. Thanks in advance. Regards, Ezhil
2007 Aug 28
0
Problem with lme using glht for multiple comparisons
...g mixed effects model, which works fine: > > LM<-lme(EFN~Leafage,L1,~1|Plant) > Now all I want to do is a post-hoc analysis (multiple comparisons) for the fixed factor EFN. I tried the following code. According to the documentation this should work: > > Post <- glht(LM, linfct = mcp(Leafage = "Tukey")) > However, I get this error message and don't know what to do: Error in mcp2matrix(model, linfct = linfct) : Factor(s) Leafage have been specified in ?linfct? but cannot be found in ?model?! The factor is specified, right? So what is the problem?...