Displaying 20 results from an estimated 2000 matches similar to: "Barchart bar lengths not proportionate"
2010 Feb 20
1
How get the single bar x coordinate in barchart when groups is used?
Hi all,
I am using barchart() to plot values above the bars. When using groups argument we get bars grouped arround a given x level. By placing values above this bars we need to know the respective x coordinates. How can I get it?
require(lattice)
da <- expand.grid(x=1:5, z=1:3, w=1:2)
da$y <- rpois(da$x, lambda=23)
barchart(y~x|w, groups=z, data=da, horizontal=FALSE,
2011 Aug 06
1
multcomp::glht() doesn't work for an incomplete factorial using aov()?
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 of contrasts and I need correcting for
multiplicity. So, I can use multcomp::glht() for this.
2012 Apr 11
1
Lattice densityplot with semitransparent filled regions
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)
# toy data...
dt <- expand.grid(A=1:2, B=1:3, y=1:50)
dt$y <- rnorm(nrow(dt), dt$B,
2011 Feb 15
1
ternary contour plot
Colin,
If your propose is to create a ternary plot with points and vectors, I think easier do this with graphics based plots instead of trellis based plots. Although, with little work you can do with trellis too. I gave you a reproducible code to put an arrow in a ternary plot. I use the function locator() to extract coordinates. The code is the following
2010 Feb 17
2
How to provide a result from D(f(x), "x") to a curve(f'(x)) ???
Hi all,
I want to provide the result from D() to curve(), because I want to plot the k-th derivative of some functions. Actually, I copy from console the result given by D() and paste inside curve(). With a lot of functions and high degree differentiation this process is tedious. Can I provide directly??
# what I actually have done (very simple function)
D(expression(x^3), "x") # copy
2010 Mar 03
1
Correct nested design for GLM
Hi,
I am currently running the following negative binomial GLM:
glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro + (0 + Micro/Trt/Year))
where Year has 3 levels, Trt has 2 levels, and Micro has 3 levels.
>From what I have read the above model has a 3 way interaction
(Year*Trt*Micro), and Micro is nest within Trt and Trt is nested with Year
(0 + Micro/Trt/Year).
I was hoping someone could
2011 May 25
1
Adjusted Rate Ratios in R
I am trying to calculate Poisson regression based adjusted rate ratios in R,
but R's default in glm does not code the intercept as the global rate. In
SAS I use "cell means" coding so that the intercept is the global rate, but
I do not know how to do this in R. If anyone knows a way to make glm use
"cell means", or an how to find adjusted rate ratios I would be grateful.
2011 Jun 15
1
Legend in lattice
Dear all, I have been working in a plot based on figure 5.6 of the Lattice book (http://lmdvr.r-forge.r-project.org/figures/figures.html).
I
have already modified it to include the size of the circles as another
variable, but I would like to modify the legend to show it (like they do
it in http://www.jstatsoft.org/v15/i05/paper). I have divided my variable in intervals:
DATA$s_Shape_2 <-
2012 Apr 12
1
Encoding of Sweave file error message
Hi
I ran the following sweave file in R2.14.1 and upgraded to R2.15
yesterday with the same setup
I got the following error message when I rand the following Sweave file
> setwd("D:/Cic/Sweave/Parasite/Comb/12")
> Sweave("D:/Cic/Sweave/Parasite/Comb/12/ParasiteComb12.Rnw")
Error: c("'ParasiteComb12DS.Rnw'", "'ParasiteComb12.Rnw'")
2010 Mar 01
3
help with lattice boxplots...
Hi All,
I need a small help with following code: I'm trying to convert "dashed
lines" to regular ones; and changing default "blue" border color to say
"black"... but I'm doing it wrong and its not working. Can anyone help
please. Thanks,
Code:
require(lattice)
ex <- data.frame(x=1:10, y=rep(c("A","B"), 5))
bwplot(y~x, data=ex,
2011 Jun 02
4
Use line break at scrip but avoid line break on graphics
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="aaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb")
but I would like a plot result like this
plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb")
I
2010 Jan 16
1
Hierarchical Linear Model using lme4's lmer
Hi,
I was wondering: I've got a dataset where I've got student 'project's
nested within 'school's, and 'division' (elementary, junior, or
senior) at the student project level. (Division is at the student
level and not nested within schools because some students are
registered as juniors & others as seniors within the same school.)
So schools are random,
2010 Jan 22
1
confidence intervals for mean (GLM)
Dear useRs,
How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM?
I need the CI's for the Poisson and Negative Binomial distributions.
Here's what I have:
mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1))
model1 <- glm(value ~ treatments, data=mydata1, family=poisson)
means1 <-
2010 Jan 23
2
About LU decomposition in R
Hi,
How can I find and download a function in R to do the LU decompostion for finding the upper and lower triangular matrix. Thank you so much.
Joe
___________________________________________________
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
[[alternative HTML version deleted]]
2010 Feb 16
2
HELP on Non-Linera Mixed-Effect model
Hi,
I'm trying to fit nonlinear mixed effects model using nlme function but getting an error message. Here is what I have:
fitted_model = nlme(scores~spline(b1,b2,b3,kt,time),
fixed = list(b1~1, b2~1, b3~1, kt~1),
random = b1+b2+b3~1,
groups= ~id,
data = sdat,
start = c(b1=3.5,b2=2,b3=.60,kt=3.5),verbose=T)
Error:
Error in
2010 Mar 14
1
confidence intervals for non-linear regression
Dear all,
I am interested to calculate confidence interval for fitted values in general for non-linear regressions. Lets say we have y=f(x1,x2,..xN) where f() is a non-linear regression. I would like to calculate a confidence interval for new prediction f(a1,..,aN). I am aware of techniques for calculating confidence intervals for coeffiecients in specific non-linear regressions and with them
2010 Mar 31
2
lattice: how to add points to the plot generated by levelplot()?
I am using levelplot() function from pkg:lattice and I want to add some
points
to the plot generated by levelplot()
similarly as in basic R graphic sequence: plot(...); points(...),
but it does not work.
I was reading documentation for lattice, but so far without much
success.
I would very much appreciate some tips.
Best regards,
Ryszard
2010 Apr 15
2
predict.lm with NAs
Hi,
I wanted to use the predict.lm() function to compare the empirical data with the predicted values.
The problem is that I have NAs in my data.
I wanted to cbind my data.frame with the empirical values with the vector I get from predict.lm.
But they don't have the same length because predict.lm just skip NA-predictions.
Is there a way to get a vector with predicted values of the same
2010 Jan 04
2
Piecewise regression in lmer
Dear all,
I'm attempting to use a piecewise regression to model the trajectory
of reproductive traits with age in a longitudinal data set using a
mixed model framework. The aim is to find three slopes and two points-
the slope from low performance in early age to a point of high
performance in middle age, the slope (may be 0) of the plateau from
the start of high performance to the
2010 Mar 25
1
Expected pairwise.student.t and TukeyHSD behavior?
pairwise.t.test is returning NAs when one of the samples only has one entry, while TukeyHSD returns results (maybe not trustworthy or believable, but results).
I stumbled on this because I did not realize one of my samples only had one entry while most of the others had several hundred, so I realize this is not a desirable situation. I'm really just curious about the difference between how