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
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
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.
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,
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
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,
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?
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
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.
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.
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
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
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,
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 -
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),
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)
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
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 -
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
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,
?
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
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)
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.
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)
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,
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 -
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
to convergence: 1
Achieved convergence tolerance: 2.713e-07
I don't know abou nls2().
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi
predicted
Sincerely.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
=rep(c(1,3),
each=num)))
Hope that helps.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
(_/
--
View this message
!
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
), 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
... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
(_/
--
View
- 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
.
Walmes Zeviani. Lavras - MG, Brasil.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
loess() or locfit() in locfit library.
Walmes - Brasil.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
/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
---
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
)
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
Read the Matrix package documentation
require(Matrix)
help(lu, html=TRUE)
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master
, type=c(p,a))
Explore the documentation and examples showed there.
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi
, 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
() procedure (help(kmeans)). I think this is what you're
looking for.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras
()
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
,
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
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
58 matches
Mail list logo