Displaying 20 results from an estimated 1000 matches similar to: "lattice: drawing strips for single-panel plots"
2012 Nov 20
1
lattice density plot: add vertical lines at groupwise medians for all panels
Suppose you have the following code:
########## Start code##########
data(Chem97, package="mlmRev")
densityplot(~gcsescore | factor(score), groups=gender, data=Chem97,
auto.key=TRUE, plot.points=FALSE, ref=TRUE,
panel=function(x,...){
panel.densityplot(x,...)
median.values <- median(x)
2008 Dec 02
1
legend idea for latticeExtra
Dear list,
I've written a small utility function to add arbitrary legend(s) to a
lattice graph (or a combination of them), much like the legend
function of base graphics. I though perhaps it could be useful to
someone else, or improved by suggestions. I understand this goes
against the lattice paradigm somewhat, in that you short-cut the link
between group variables and the
2011 Jun 29
1
lmer() computational performance
Hello, running a mixed model in the package LME4, lmer()
Panel data, have about 322 time periods and 50 states, total data set is
approx 15K records and about 20 explanatory variables. Not a very
large data set.
We run random intercepts as well as random coefficients for about 10 of
the variables, the rest come in as fixed effects. We are running into
a wall of time to execute these models.
2010 Jan 26
0
create custom function to annotate a levelplot
Dear list users,
I modeled the probability of occurrence of one species: "Cyperus
dilatatus".
I modeled the species using three different approaches:
c("random","target","index")
What I want to achieve is to make a plot of all prediction maps in a row
with to conditional variables, that is, with the species and the
approach
I prepared a data.frame to try
2007 Jun 10
1
{nlme} Multilevel estimation heteroscedasticity
Dear All,
I'm trying to model heteroscedasticity using a multilevel model. To
do so, I make use of the nlme package and the weigths-parameter.
Let's say that I hypothesize that the exam score of students
(normexam) is influenced by their score on a standardized LR test
(standLRT). Students are of course nested in "schools". These
variables are contained in the
2006 Mar 29
1
Lmer BLUPS: was(lmer multilevel)
Paul:
I may have found the issue (which is similar to your conclusion). I
checked using egsingle in the mlmRev package as these individuals are
strictly nested in this case:
library(mlmRev)
library(nlme)
fm1 <- lme(math ~ year, random=~1|schoolid/childid, egsingle)
fm2 <- lmer(math ~ year +(1|schoolid:childid) + (1|schoolid), egsingle)
Checking the summary of both models, the output is
2010 Dec 15
1
Problems drawing a colored 'rug' in the Lattice 'densityplot'
Hi All,
I'm trying to add a 'rug' representation of my data to a plot created
with densityplot(). While I can do this in the simple case, I can't do
it properly when I include the "groups" argument. I have an example
below. I am running a reasonably new version of R.
print(sessionInfo())
R version 2.12.0 Patched (2010-11-07 r53537)
Platform: i686-pc-linux-gnu
2006 Nov 28
1
Slight discrepancy between predict.lm() and all.effects()
In the course of exploring response prediction, I stumbled upon a
small discrepancy between the CIs produced by predict.lm() and
all.effects()
require(mlmRev)
require(effects)
hsb.lm <- lm(mAch ~ minrty * sector, Hsb82)
hsb.new <- data.frame(
minrty = rep(c('No', 'Yes'), 2),
sector = rep(c('Public', 'Catholic'), each = 2))
hsb.eff <-
2008 Jun 15
2
R vs SAS and HLM on multilevel analysis- basic question
Hi R users!
I am trying to learn some multilevel analysis, but unfortunately i am now very confused. The reason: http://www.ats.ucla.edu/stat/hlm/seminars/hlm_mlm/mlm_hlm_seminar.htm
http://www.ats.ucla.edu/stat/sas/seminars/sas_mlm/mlm_sas_seminar.htm
and
MlmSoftRev. pdf from mlmRev package.
>From what i see, the first two links seem to declare the level one variable as a random part (i
2008 Aug 08
1
Lattice: regression lines within grouped xyplot panels
Dear community,
I am looking for a possibility to draw 'regression lines' instead of
'smooth' lines in grouped xyplots. The following code should give you a
small example of the data structure.
library(lattice)
data(Gcsemv, package = "mlmRev")
# Creates artificial grouping variable ...
Gcsemv$Groups <-
ifelse(as.numeric(as.character(Gcsemv$school))>65000,
2006 Feb 16
1
help downloading lme4 from CRAN
Hello. I am having trouble downloading the lme4 package from the CRAN
site. The error is:
> local({a <- CRAN.packages()
+ install.packages(select.list(a[,1],,TRUE), .libPaths()[1],
available=a, dependencies=TRUE)})
trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 26129 bytes
opened URL
downloaded 25Kb
2009 Mar 23
1
lattice multipanel strip placement - with two factors
Hi,
I'm making a multipanel lattice densityplot figure with 2 factors (3 and
20 classes in each factor) with the following statement (the
type="percent" is there to prevent plotting the actual points which
detract from the figure - is there another way of doing this?):
densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12),
xlab="Element
2010 Mar 12
1
Problem installing new packages
Hi everyone,
Using R 2.10.1 on Windows Vista.
DOWNLOADED PACKAGES DO NOT INSTALL. I expect to see them in C:\Program
Files\R\R-2.10.1\library These files download (see below). And they are
all in zip format. What am I doing wrong? Please help. All suggestions
appreciated.
trying URL
'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/RColorBrewer_1.0-2.zip'
Content type
2012 Aug 08
3
Can not find lme
Dear all,
Can anyone help me, my R software can not run a nested linear regression by using the lme funcion. The message that appears isĀ
Error: could not find function "lme"
I already downloaded and loaded the package, please see below. Thank you in advance for any help! Nadia.
> data<-read.csv("/Users/nadiasan1/Desktop/MOE and MOR.csv")> attach(data)>
2007 Sep 20
1
Bug with Cor(..., method='spearman") and by() (PR#9921)
I posted this on R help, and a few others responded indicating they too
were able to replicate the error as a function of missing data. I
believe this should not be the case and hence and reporting it here.
### Code provided on R-Help by Ivar Herfindal
# Simulate data
testdata <- cbind.data.frame(gr=3Drep(letters[1:4], each=3D5), =
aa=3Drnorm(20),
bb=3Drnorm(20))
# Introduce some missingness
2006 Dec 01
3
Vertical line in densityplot?
Hi all,
I'm trying to get a vertical line at a specific point in a
densityplot. abline seems to be what's required, but it doesn't align
itself to the scale used in the plot.
example:
library(lattice)
x<-rnorm(100)
plot.new()
densityplot(x)
abline(v=0)
-----
The line seems to use some other coordinate system. What kind of call
do I use to make abline use the graph's
2008 Dec 11
2
call lattice function in a function passing "groups" argument
I'm trying to use a lattice function within a function and have problems
passing the "groups" argument properly. Let's say I have a data frame
d <- data.frame(x = rnorm(100), y = c("a", "b"))
and want to plot variable x in a densityplot, grouped by the variable y, then
I would do something like
densityplot(~ x, d, groups = y)
If however I wanted to
2012 Feb 22
2
Several densityplots in single figure
Hi,
I have created two separate overlapping density plots- see example code
below.
What I wish now to do is combine them into one figure where they sit side
by side.
Any help would be great!
many thanks in advance, josh.
#####################
thedataA <- data.frame(x1=rnorm(100,1,1),x2=rnorm(100,3,1)) #create data
thedataA.m<-melt(thedataA)
densityplot(~value, thedataA.m,
2008 Aug 26
2
awkward behavior with densityplot function
Hi,
I have the following script:
---- t.R ---
grafica <- function() {
v <- read.csv('preprocessed/komolongma.ece.uprm.edu.active',sep=',')
x <- as.ts(v$active)
bitmap(file="output.png")
densityplot(~x,col='blue',main='Density Plot')
dev.off()
}
grafica()
---- t.R ---
When I "sourced" it from R prompt, it quietly runs.
2006 Nov 27
1
Help with response CIs for lme
Hi,
Can someone please offer a procedure for going from CIs produced by
intervals.lme() to fixed-effects response CIs.
Here's a simple example:
library(mlmRev)
library(nlme)
hsb.lme <- lme(mAch ~ minrty * sector, random = ~ 1 | cses, Hsb82)
(intervals(hsb.lme))
(hsb.new <- data.frame
minrty = rep(c('No', 'Yes'), 2),
sector = rep(c('Public',