[R] Diference in results from doBy::popMeans, multcomp::glht and contrast::contrast for a lme model

2012-11-05 Thread Walmes Zeviani
Hello R users, I'm analyzing an experiment in a balanced incomplet block design (BIB). The effect of blocks are assumed to be random, so I'm using nlme::lme for this. I'm analysing another more complex experiments and I notice some diferences from doBy::popMeans() compared multcomp::glht() and

Re: [R] question how to add Standard Deviation as Whiskers in a simple plot

2012-05-28 Thread Walmes Zeviani
This post are useful. http://myowelt.blogspot.com.br/2008/03/beautiful-error-bars-in-r.html http://mapas.mma.gov.br/i3geo/pacotes/rlib/win/gplots/html/plotCI.html Walmes. == Walmes Marques Zeviani LEG (Laboratório de

Re: [R] confidence intervals for nls or nls2 model

2012-05-16 Thread Walmes Zeviani
If you want a confidence based in new x values you can do. I have this post with steps to do this. It's written in Portuguese but the R code is useful. http://ridiculas.wordpress.com/2011/05/19/bandas-de-confianca-para-modelo-de-regressao-nao-linear/ Bests. Walmes.

Re: [R] VarCorr procedure from lme4

2012-05-01 Thread Walmes Zeviani
It could be a bad coexistence between packages in the same R session. Are you using nlme and/or doBy packages too? Bests. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S,

Re: [R] error bars for a barchart

2012-05-01 Thread Walmes Zeviani
I have a repoducibe example here http://ridiculas.wordpress.com/2011/11/23/media-e-desvio-padrao-de-muitas-variaveis-separado-por-grupos/ Sorry for it be in Portuguese. Walmes. == Walmes Marques Zeviani LEG (Laboratório de

Re: [R] How to test if a slope is different than 1?

2012-04-25 Thread Walmes Zeviani
You can also run two nls() models, one under h0 restriction, other under no restriction or h1, and compare them (if they are nested) by likelihood ratio test using anova() method, look x1 - seq(0,10,l=15) x2 - runif(x1) set.seed(1) y - x1+0.5*x2+rnorm(x1,0,0.01) nls.h0 - nls(y~b0+x1+b2*x2,

[R] Lattice densityplot with semitransparent filled regions

2012-04-11 Thread Walmes Zeviani
Hello, I'm doing some graphics for a paper and a need customize such with filled region above the density curve. My attempts I get something very near what I need, but I don't solve the problem of use semitransparent filled. Below a minimal reproducible code. Someone has any idea?

Re: [R] Lattice densityplot with semitransparent filled regions

2012-04-11 Thread Walmes Zeviani
Thank you Ilai. Problem solved. There is a small detail, alpha affects the rug and the curve line opacity too. Is possible to specify it just to polygon? Bests. == Walmes Marques Zeviani LEG (Laboratório de Estatística e

Re: [R] Encoding of Sweave file error message

2012-04-11 Thread Walmes Zeviani
I had the same problem! So, as I'm a linux user, I prefer use linux terminal. On terminal I type this to compile R CMD Sweave --encoding=utf-8 myfile.Rnw and the compilation is successful. Try to set the encoding option in Sweave(). Bests. Walmes.

Re: [R] Odp: Multiple plots in one subplot

2011-12-16 Thread Walmes Zeviani
You can use a different way of split the plotting area that is by means of layout() function. x - rnorm(100) M - matrix(c(rep(1:5, e=2), 6, 7), byrow=TRUE, nrow=2) layout(M) plot(x) hist(x) qqnorm(x) boxplot(x) plot(density(x)) plot(abs(x)) hist(abs(x)) Bests. Walmes.

[R] multcomp::glht() doesn't work for an incomplete factorial using aov()?

2011-08-06 Thread Walmes Zeviani
Hi R users, I sent a message yesterday about NA in model estimates ( http://r.789695.n4.nabble.com/How-set-lm-to-don-t-return-NA-in-summary-td3722587.html). If I use aov() instead of lm() I get no NA in model estimates and I use gmodels::estimable() without problems. Ok! Now I'm performing a lot

[R] How set lm() to don't return NA in summary()?

2011-08-05 Thread Walmes Zeviani
Hi, I've data from an incomplete fatorial design. One level of a factor doesn't has the levels of the other. When I use lm(), the summary() return NA for that non estimable parameters. Ok, I understant it. But I use contrast::contrast(), gmodels::estimable(), multcomp::glht() and all these fail

[R] Tables and merge

2011-07-05 Thread Walmes Zeviani
Silvano, I have some examples using merge() from my class notes in http://www.leg.ufpr.br/doku.php/disciplinas:ce223-2011-01. See aula11.R. For the moment, this minimal reproducible code can be useful id - 1:30 n - 20 a1 - data.frame(id=sample(id, n), v1=rnorm(n)) a2 - data.frame(id=sample(id,

Re: [R] Error singular gradient matrix at initial parameter estimates in nls

2011-06-30 Thread Walmes Zeviani
I think that these aren't good initial values. If you do a plot of data and add a curve, the curve don't approximate the data. Frequently I use interactive procedures to get good initial values. Using playwith() you can handle sliders to adjust values and use in nls(), look the following r -

Re: [R] Legend in lattice

2011-06-15 Thread Walmes Zeviani
Júlio, Your code is not reproducible, you doesn't provide any data. So I did a minimal code that illustrates a possible procedure is the following n - 30 da - data.frame(x=runif(n), y=runif(n), z=runif(n)) da$z - cut(da$z, seq(0,1,0.25)) require(lattice) xyplot(y~x, da, cex=as.numeric(da$z),

Re: [R] logistic growth model

2011-06-06 Thread Walmes Zeviani
If you use RStudio (www.rstudio.org) you can find good initial start values by interactive plot using manipulate() function. Look the simple code below. age - 1:20 k - 3; b0 - -5; b1 - .5 y - k*exp(b0+b1*age)/(1+exp(b0+b1*age))+rnorm(age,0,0.1) plot(y~age) start - list() require(manipulate)

[R] Use line break at scrip but avoid line break on graphics

2011-06-02 Thread Walmes Zeviani
Hello list, I have plots with long strings in main=, ylab= or xlab=. So, in I my script I use break long lines to avoid lines hiden on my monitor and in sweave document pages. I use graphics like this plot(1, main= ) but I would like a plot

[R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
Hello list, I'm doing a table with scores and I want include colors to represent status of an individual. I'm using sweave results=tex= and xtable but I can't get a result I want. My attemps are #- # code R da -

Re: [R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
Marc, Thank you very much. You gave exactly what I wanted. Bests. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departamento de Estatística - Universidade

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
You can use mtext() par(mar=c(5.1,4.1,4.1,5.1)) plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= 'green') axis(4, col='green') mtext(side=4, text=label green, line=2) par(new = TRUE) plot(x$Time, x$y3,

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
? Jun On Thu, May 26, 2011 at 1:24 PM, Walmes Zeviani walmeszevi...@gmail.comwrote: You can use mtext() par(mar=c(5.1,4.1,4.1,5.1)) plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= 'green

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
Jun, The par() command is to give extra margin on right side to accomodate the y axis label. I recognize, like Rolf, that three y axis can be cumbersome, confuse. So, I would adopt another approach using lattice::xyplot() require(reshape) x - melt(x, id=Time) str(x) require(lattice)

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
Victor, I agree with Marc's point of view. So, if you can use another representation of you data, like points, considering looking at http://lmdvr.r-forge.r-project.org/figures/figures.html figures 10.20 and 10.21 for a start point. Walmes.

Re: [R] Adjusted Rate Ratios in R

2011-05-25 Thread Walmes Zeviani
Matthew, You can change the matrix (restriction) involved. Start from help(contr.sum) to know how specify this. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
You can produce a graph similar to the ggplot with lattice::barchart, require(lattice) dataset - data.frame(Main=c(A,A,A,B,B), Detail=c(a,b,c,1,2), value=runif(5, min= 0.5, max=1)) barchart(value~Detail|Main, data=dataset,

[R] Using deriv3() in a separated nonlinear regression model

2011-05-25 Thread Walmes Zeviani
Hi all, I'm adjusting a nonlinear regression model for data that has a categorigal variable present. So, I can use nls() to do this considering the categorical variable, like this # da - expand.grid(tr=gl(2,1,la=c(tr)), x=1:12) da$y -

Re: [R] using the design matrix to correctly configure contrasts

2010-06-02 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] splitting a factor in an analysis of deviance table (negative binomial model)

2010-05-28 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] nls() and nls2() behavior?

2010-05-11 Thread Walmes Zeviani
to convergence: 1 Achieved convergence tolerance: 2.713e-07 I don't know abou nls2(). Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani

Re: [R] NLS Singular Gradient Error

2010-04-28 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] basic table statistics

2010-04-24 Thread Walmes Zeviani
. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi

Re: [R] predict.lm with NAs

2010-04-15 Thread Walmes Zeviani
predicted Sincerely. Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation

Re: [R] using nls for gamma distribution (a,b,d)

2010-04-15 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] mouse-clicking on xy-plot

2010-04-02 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras

Re: [R] Line Graph Labels

2010-04-01 Thread Walmes Zeviani
... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] Line Graph Labels

2010-04-01 Thread Walmes Zeviani
=rep(c(1,3), each=num))) Hope that helps. Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural

Re: [R] lattice: how to add points to the plot generated by levelplot()?

2010-03-31 Thread Walmes Zeviani
... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil (_/ -- View this message

Re: [R] Expected pairwise.student.t and TukeyHSD behavior?

2010-03-24 Thread Walmes Zeviani
! Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation

Re: [R] testing parallelism of does-response curves using package drc

2010-03-17 Thread Walmes Zeviani
), B=c(12,12))) n1 - nls(y~A*x/(B[trat]+x), data=da, start=list(A=c(9.5), B=c(12,12))) anova(n1,n0) Look at gnls() function in the nlme package for a easier way to specify the model. Walmes Zeviani. - ..ooo0

Re: [R] confidence intervals for non-linear regression

2010-03-14 Thread Walmes Zeviani
... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil (_/ -- View

Re: [R] Correct nested design for GLM

2010-03-03 Thread Walmes Zeviani
- expand.grid(A=factor(1:3), B=factor(1:3))[rep(1:9, 3),] da$y - rnbinom(da$A, size=10, prob=0.5) m1 - glm.nb(y~A*B, data=da) anova(m1) m2 - glm.nb(y~A/B, data=da) anova(m2) m3 - glm.nb(y~A*B+(A/B), data=da) anova(m3) Bests. Walmes Zeviani. - ..ooo0

Re: [R] help with lattice boxplots...

2010-03-01 Thread Walmes Zeviani
. Walmes Zeviani. Lavras - MG, Brasil. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation

Re: [R] HELP on Non-Linera Mixed-Effect model

2010-02-16 Thread Walmes Zeviani
loess() or locfit() in locfit library. Walmes - Brasil. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural

Re: [R] Triangular filled contour plot

2010-02-16 Thread Walmes Zeviani
/n1557735/one.png I think (and hope :-) ) Deepayan Sarkar will implement this on Lattice soon because R doesn't have this kind of graphic yet. My code isn't perfect so I expect suggestions. Walmes Zeviani, Brasil. - ..ooo0

Re: [R] Confidence intervals nls

2010-02-15 Thread Walmes Zeviani
--- matplot(days, predict(model,list(DOY = days))+ outer(se.fit, qnorm(c(.5, .025,.975))), type=l, col=c(1,2,2), lty=c(1,2,2)) #- Sincerely. Walmes Zeviani. - ..oooO

Re: [R] problem with nls function

2010-01-25 Thread Walmes Zeviani
) At your disposal. Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation

Re: [R] About LU decomposition in R

2010-01-23 Thread Walmes Zeviani
Read the Matrix package documentation require(Matrix) help(lu, html=TRUE) Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master

Re: [R] confidence intervals for mean (GLM)

2010-01-22 Thread Walmes Zeviani
, type=c(p,a)) Explore the documentation and examples showed there. At your disposal. Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani

Re: [R] Remove term from formula for predict.lm

2010-01-19 Thread Walmes Zeviani
. Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation

Re: [R] Model

2010-01-19 Thread Walmes Zeviani
.. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] Hierarchical Linear Model using lme4's lmer

2010-01-16 Thread Walmes Zeviani
.. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil

Re: [R] Barchart bar lengths not proportionate

2010-01-14 Thread Walmes Zeviani
. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Walmes Zeviani
, minimal, self-contained, reproducible code. Adam, A segmented linear model, for estimation purposes, is a nonlinear model. It requires a iteractive procedure for estimation of fixed effects. You could use nlmer() for this. Walmes Zeviani, Lavras - MG, Brasil. - ..oooO

Re: [R] multivariate group means

2010-01-04 Thread Walmes Zeviani
() procedure (help(kmeans)). I think this is what you're looking for. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics

Re: [R] Adding a distance scale to a plot?

2010-01-04 Thread Walmes Zeviani
.. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_). )../ walmeszevi...@hotmail.com, Lavras

Re: [R] Trellis Plot

2009-11-24 Thread Walmes Zeviani
() trellis.focus('strip', 1, 2, highlight=FALSE) ltext(0,.5,'4',col='red', pos=4) ltext(1,.5,'10',col='black', pos=2) trellis.unfocus() #dev.off() Walmes Zeviani, Brasil. ychu066 wrote: anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot

Re: [R] Titles on lattice colorkey

2009-11-02 Thread Walmes Zeviani
, colorkey=list(space=right, title=Doesn't work), legend=list(top=list(fun=grid::textGrob(Size\n(m), x=1.09 Walmes Zeviani. -- View this message in context: http://old.nabble.com/Titles-on-lattice-colorkey-tp22868692p26156677.html Sent from the R help mailing list archive at Nabble.com

Re: [R] superscript in ylab

2009-10-29 Thread Walmes Zeviani
Try ylab=expression(Temperature*degree*C)) type demo(mathplot) at R prompt for more customizations. Walmes Zeviani Lavras - MG, Brasil. Lathouri, Maria wrote: Dear all I am doing some plots in R. I want to have as label in y-axis Temperature (oC). I have used ylab=expression(paste