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 con
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 Estatís
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.
==
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
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, 49.2317
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, st
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.
===
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 Geoi
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?
require(lattice
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 o
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 wh
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
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 <-
c(1.
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
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 Federa
Hello list,
I'm doing a table with scores and I want include colors to represent status
of an individual. I'm using sweave <>= and xtable but I can't
get a result I want. My attemps are
#-
# code R
da <- data.frame(id=le
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)
xyplot(va
h, Walmes.
>
> One more concern, the new Y axes added do not extend all the way down to
> cross with x axis. Is there anyway to make them look like the very first Y
> axis on the left?
>
> Jun
>
> On Thu, May 26, 2011 at 1:24 PM, Walmes Zeviani
> wrote:
>
>> Yo
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, ty
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 <
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,
s
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)
D
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.
===
t;A1"),
list(B="B2", A="A1"))
c0
c0$X
Walmes.
-
..ooo0
.......
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agr
51 44.357 0.59629
B.A4 3 9.284448 35.073 0.02574 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
Walmes.
-
..ooo0
.......
..()... 0ooo...
‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1331 on 11 degrees of freedom
Number of iterations to convergence: 1
Achieved convergence tolerance: 2.713e-07
I don't know abou nls2().
Walmes.
-
..ooo0
......
ed convergence tolerance: 6.673e-07
>
Bests.
-
..ooo0
.......
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_)...
y(val, ty, basicStats)))
rownames(result) <- nam
result
Bests.
-
..ooo0
.......
..(....)... 0ooo... Walmes Zeviani
...\..(.(.)...
y.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.
ata=da) # NA predicted
Sincerely.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Exp
mes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmesz
ow(da):(nrow(da)-5))], pos=rep(c(1,3),
each=num)))
Hope that helps.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistic
-
..ooo0
...
..()... 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
(_/
--
View th
ance matriz
m0 <- aov(y~A, da)
vcov(m0)
TukeyHSD(m0) # no problem!
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)...
art=list(A=c(9,10), 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
... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@hotmail.com, Lavras - MG, Brasil
(_/
--
View
#x27;t are used.
da <- 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)
B
la=list(lty=1, col="black"))
)
Sincerely.
Walmes Zeviani. Lavras - MG, Brasil.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Ma
TAT. You
will welcome.
Bests.
Walmes Zeviani. Lavras, MG, Brasil.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics
2, sqrt(3)/2, label="cross", pos=3)
panel.text(1, 0, label="resin", pos=4)
trellis.unfocus()
http://n4.nabble.com/file/n1557735/one.png
I think (and hope :-) ) Deepayan Sarkar will implement this on Lattice soon
because R doesn't h
d
use loess() or locfit() in locfit library.
Walmes - Brasil.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricul
1,
function(x) sum(vcov(model)*outer(x,x
# plot ---
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))
#---------
)
summary(m0)
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experi
Read the Matrix package documentation
require(Matrix)
help(lu, html=TRUE)
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in
distribute.type=TRUE, type=c("p","a"))
Explore the documentation and examples showed there.
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo...
uld do.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Experimentation
\_). )../ walmeszevi...@ho
a=new)[1:5]
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricult
w.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
-
..oooO
..........
..()... 0ooo... Walmes Zeviani
...\..(..
g guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
-
..oooO
..........
..()... 0ooo...
contained, reproducible code.
>
>
JustADude,
Take a look at help documentation of spplot() function on the sp package.
This function offer the scale mark on the plot.
-
..oooO
......
vide commented, minimal, self-contained, reproducible code.
>
>
Ondra,
Look at kmeans() procedure (help(kmeans)). I think this is what you're
looking for.
-
..oooO
..........
..()... 0ooo.
e commented, 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
x27;black', pos=2)
trellis.unfocus()
trellis.focus('strip', 2, 1, highlight=FALSE)
ltext(0,.5,'30',col='red', pos=4)
ltext(1,.5,'20',col='black', pos=2)
trellis.unfocus()
trellis.focus('strip', 1, 2, highlight=FALSE)
ltext(0,.5,'4
g guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
Maybe using library(grid) we can solve. Try
levelplot(z~x*y, grid, cuts = 50, scales=list(log="e"), xlab="",
ylab="&
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).
59 matches
Mail list logo