, the result of
aggregate is showed. Why this behaviour? What I can do to avoid it?
> require(plyr)
>
> hab <-
+ read.table("http://www.leg.ufpr.br/~walmes/data/ipea_habitacao.csv";,
+header=TRUE, sep=",", stringsAsFactors=FALSE, quote="&qu
h-implicit_figures
--output teste01.html --smart --email-obfuscation none --standalone
--section-divs --table-of-contents --toc-depth 3 --template
/home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html
--css /home/walmes/Dropbox/ridiculas/markdown/ridiculas.css --variable
the
html --from
markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures
--output teste01.html --smart --email-obfuscation none --standalone
--section-divs --table-of-contents --toc-depth 3 --template
/home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html
-
incipal results are appended.
Thank you.
# reading BIB data
da <- read.table("http://www.leg.ufpr.br/~walmes/data/pimentel_bib3.txt";,
+ header=TRUE, sep="\t",
colClasses=c("factor","factor",NA))
str(da)
## 'data.frame':30 ob
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.
W
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
~b0+x1+b2*x2, start=c(b0=1, b2=1))
nls.h1 <- nls(y~b0+b1*x1+b2*x2, start=c(b0=1, b1=1, b2=1))
summary(nls.h1)
anova(nls.h0, nls.h1)
another option is to adjust a model parametrized according to test h0, like
nls.h2 <- nls(y~b0+(b1+1)*x1+b2*x2, start=c(b0=1, b1=-1, b2=1))
summary(nls.
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.
W
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
lygon") to fill
densityplot(~y|B, groups=A, data=dt,
plot.points="rug", col=2:3,
panel=panel.superpose,
panel.groups=my.panel.densityplot)
Thanks!
Walmes.
==
Walmes Marques Zevian
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.
;A"))
summary(m0)
coef(m0)
# adjust incomplete factorial
m1 <- aov(y~cult*fert, da)
summary(m1)
coef(m1)
require(multcomp)
glht(m0, linfct=matrix(c(1,1,10,0), nrow=1)) # work
glht(m1, linfct=matrix(c(1,1,0,10,0), nrow=1)
tC:fertNA NA NA NA
...
> require(gmodels)
> estimable(m0, cm=c(1,0,0,100,0,0))
Erro em estimable.default(m0, cm = c(1, 0, 0, 100, 0, 0)) :
Dimension of structure(c(1, 0, 0, 100, 0, 0), .Dim = c(1L,
.org/doku.php?id=tips:data-frames:merge
You can also join to the R-br mailing list (brazilian R-help list).
Instructions in http://www.leg.ufpr.br/doku.php/software:rbr
Bests.
Walmes.
======
Walmes Marques Zeviani
LEG (Laborat
exp(((-4*pi*En*Na)*((ro/2)*(r-ro)^2+(1/3)*(r-ro)^3))/(R*T)),
start=start, trace=TRUE)
Bests.
Walmes.
======
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)
Departam
s.numeric(da$z), col=1,
key=list(points=list(cex=1:4, pch=1), text=list(levels(da$z)),
columns=4))
Bests,
Walmes.
======
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)
D
ridiculas.wordpress.com/2011/04/09/metodo-grafico-interativo-para-valores-iniciais-em-regressao-nao-linear/
Bests.
Walmes.
======
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)
D
uld like a plot result like this
plot(1, main=" ")
I remember once I saw a meta character like "\n" that avoid this breack line
plot(1, main="\(?)
")
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
\{ 10.00 \} \\
\hline
\end{tabular}
#-
desired result (lines omited to save space)
#-
1 & a & \textcolor{red}{ 2.00 }
ttice)
xyplot(value~Time|variable, data=x, layout=c(3,1),
type="l", scales=list(y=list(relation="free")))
Walmes.
======
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geoinformação, 25.45041
e')
##axis(4, col='blue', line = -4)
axis(4, at=seq(0,0.12,0.02), col='blue', line = -4)
mtext(side=4, text="label green", line=-2)
ti <- axTicks(4)
ti.delta <- diff(ti)[1]
ti.expan <- seq(ti[1]-ti.delta, ti[length(ti)]+ti.delta, ti.delta)
ti.expan
axis(
27;)
mtext(side=4, text="label green", line=2)
par(new = TRUE)
plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col =
'blue')
axis(4, col='blue', line = -4)
mtext(side=4, text="label green", line=-2)
Walm
l(x, A[tr], B[tr]), data = da, start = list(A = c(10, :
fator de passos 0.000488281 reduzido abaixo de 'minFactor' de 0.000976562
#
That indicates th
quot;),
value=runif(5, min= 0.5, max=1))
barchart(value~Detail|Main, data=dataset,
scales=list(x=list(relation="free")))
Walmes.
==
Walmes Marques Zeviani
LEG (Laboratório de Estatística e Geo
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
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.
W
-
# draw an arrow with the coordinates extracted
arrows(id$x[1], id$y[1], id$x[2], id$y[2])
#------
At your disposal.
Walmes.
====
Walme
="")), rep=1:4)
eta <- model.matrix(~A*B, da)%*%matrix(c(0, 1,2, -1,0,1, 0,1,2, 0,0,0))
da$y <- rnorm(da$A, mean=eta, sd=1)
g0 <- lm(y~A*B, data=da)
anova(g0)
require(contrast)
c0 <- contrast(g0,
list(B="B1", A=&quo
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...
Mr. Murrell,
It is exactly what I want. Thanks very much.
Walmes.
> Date: Thu, 27 May 2010 10:27:02 +1200
> From: p.murr...@auckland.ac.nz
> To: walmeszevi...@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] Is possible a mini-plot into a big plot with Lattice?
>
Hello,
I want to do with Lattice functions (qqmath, histogram) a figure like this
below.
n <- 1000
x <- rnorm(n)
qqnorm(x); qqline(x)
op <- par(fig=c(.02,.5,.5,.98), new=TRUE)
hist(x, xlab="", ylab="", main="", axes=FALSE)
box()
par(op
‘.’ 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
...\..(.(.)...
5, 1, 2), 0, 20)
da <- data.frame(x=1:20)
da$z <- gammafun(da$x, 5, 1, 2)+rnorm(da$x,0,1)
plot(z~x, da)
curve(gammafun(x, 5, 1, 2), add=TRUE)
n1 <- nls(z~gammafun(x, alpha, B, b), data=da,
start=list(alpha=5, B=1, b=2))
Sincerel
ata=da) # NA predicted
Sincerely.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricultural
Exp
You can use identify() to obtain coordinates from plotted points but if you
want any coordinates you could use locator():
> plot(1:10)
> loc <- locator(n=3)
> str(loc)
List of 2
$ x: num [1:3] 2.3 5.4 8.29
$ y: num [1:3] 6.15 8.33 2.6
> points(loc$x, loc$y, col=2)
>
Wal
ow(da):(nrow(da)-5))], pos=rep(c(1,3),
each=num)))
Hope that helps.
Walmes.
-
..ooo0
...
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistic
You can adapt the following example
da <- data.frame(y=rnorm(50), x=1:50)
plot(y~x, data=da)
abline(h=c(-2,2), lty=3)
with(da, text(x[abs(y)>2], y[abs(y)>2], label=x[abs(y)>2], pos=2))
Walmes.
l=function(...){
panel.levelplot(...)
grid.points(runif(100,0,10), runif(100,0,10), pch=2)
}
)
Walmes
-
..ooo0
...
..(...
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
In the paste I had provided one possible solution to this, see
http://n4.nabble.com/Confidence-intervals-nls-td1556487.html#a1556702
Walmes.
-
..ooo0
...
..()... 0ooo
calculation with real data (but not so trivial) that can able me to create my
functions?
Thanks a lot.
Walmes Zeviani.
Bates; Hamilton; Watts. Calculation onf intrinsic and parameter-effects
curvatures for nonlinear models. Communications in statistics - simulations and
computation, 469-477, 1
#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
panel.text(x+c(-d,0,d), y, label=y, pos=3)
})
Thanks in advance.
Walmes Zeviani, Lavras - MG, Brasil.
_
os.
dium=Tagline&utm_campaign=InfuseSocial
[[altern
)))
curve(noquote(as.character(as.expression(D(expression(x^3), "x")
Thanks in advance.
Walmes Zeviani, Brasil.
_
Quer deixar seus vídeos mais divertidos? Com o Movie Maker is
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...
Jim,
Did you read the posting guide?
Did you do a google search, for example, with terms like "[R] generalized
linear models", "[R] count models", "[R] poisson regression"?
I think you sho
a=new)[1:5]
At your disposal.
Walmes.
-
..oooO
..
..()... 0ooo... Walmes Zeviani
...\..(.(.)... Master in Statistics and Agricult
Doug,
It appears you are mixing nlme and lme4 formulation type.
On nlme library you type
lme(y~x, random=~1|subjetc)
On lme4 library you type
lmer(y~x+(1|subject))
You mixed them.
At your disposal.
Walmes.
Doug Adams wrote:
>
> Hi,
>
> I was wondering: I've got a datas
ylim=c(0, 1.05*max(da$y)))
At your disposal.
Walmes.
Rex C. Eastbourne wrote:
>
> When I use barchart (with default formatting options), I get bars whose
> lengths/heights are not proportional to their value. For example:
>
> http://drop.io/wbagm6s/asset/capture-png
&g
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).
68 matches
Mail list logo