Displaying 20 results from an estimated 10000 matches similar to: "Plotting curves in lattice panels"
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 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,
2004 Aug 26
1
Plotting groupedData objects
I am trying to create a plot similar to Figure 3.2 in Bates and Pinheiro.
I have repeated measurements on about 80 subjects from 2 treatment groups.
I would like to have the panels for the two treatment groups in separate
groups and within those groups have the panels ordered on maximum value
(as is the default).
I am ok with getting plots similar to Figs 3.1 and 3.2, but can't see how
to
2012 Sep 11
1
Plotting every probability curve
I don't have a logistic regression model and am trying to generate
probability curves for all possible combinations of
the variables. My logit model has 5+ variables, and I want to draw curves
for every scenario.
See code below. When home_owner is 0 and 1, I want curves. The same goes
for all other variables categories, so that
I have permutations for all possible combinations.
I've
2007 Jun 11
1
Recoding
I want to do some recoding of variables: code Age into groups and recode a
factor into a smaller number of levels.
There are a couple of options for recode functions, in the car package and
in memisc, and I think in gmisc.
Does anyone have any opinions on the the easiest, most reliable approach
for these problems?
David Scott
_________________________________________________________________
2008 Jan 27
2
[OT] Open source archive program on windows
I am looking for a recommendation for an open source competitor to Winzip.
I seem to recall Brian Ripley mentioning one in the last year or so, but
couldn't find it in the mail archives. (Searching on Ripley there is
somehow not terribly useful.)
Suggestions?
David Scott
_________________________________________________________________
David Scott Department of Statistics, Tamaki Campus
2008 Mar 20
2
Cygwin and Rtools
I have just got a new machine and had a basic cygwin installed before it
was given to me. It didn't include make. Previously I have installed
Rtools to build packages and now I have got myself a bit confused as to
whether to just install make from the cygwin packages or to install
rtools. I would welcome any advice. I had a look at the rtools section in
the Administration Manual and the
2008 Jan 22
1
Reading .csv file under linux
I have encountered a problem with reading a .csv file on a linux box. I
can read the file on my windows machine (under XP) but on the linux box it
gives :
> patients <- read.csv("../Patients.csv", header = FALSE,
+ col.names = patientsNames)
Error in type.convert(data[[i]], as.is = as.is[i], dec = dec,
na.strings = character(0)) :
invalid multibyte string
2007 May 28
2
RODBC and Date/Time variables
This is really a query about MySQL which I am trying to use to set up a
database which I will then access with RODBC.
I have my data in a .csv file, and some of the fields are date/time
fields. I tried to create a table using mysql with the definition of the
date/time field given by
CallDate DATETIME,
but I got an error saying that the first row has
28/07/2006 0:00
in that field. What I
2008 Feb 11
4
R programming style
I am aware of one (unofficial) guide to style for R programming:
http://www1.maths.lth.se/help/R/RCC/
from Henrik Bengtsson.
Can anyone provide further pointers to good style?
Views on Bengtsson's ideas would interest me as well.
David Scott
_________________________________________________________________
David Scott Department of Statistics, Tamaki Campus
The University of Auckland,
2008 May 29
2
Troubles plotting lrm output in Design Library
Dear R-helpers,
I'm having a problem in using plot.design in Design Library. Tho
following example code produce the error:
> n <- 1000 # define sample size
> set.seed(17) # so can reproduce the results
> age <- rnorm(n, 50, 10)
> blood.pressure <- rnorm(n, 120, 15)
> cholesterol <- rnorm(n, 200, 25)
> sex <-
2004 May 06
3
strptime
Delving into the murky world of dates and times I found this:
dates <- c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92")
> times <- c("23:03:20", "22:29:56", "01:03:30", "18:21:03", "16:56:26")
> x <- paste(dates, times)
> z <- strptime(x, "%m/%d/%y
2010 Aug 14
1
How to add lines to lattice plot produced by rms::bplot
I have a plot produced by function bplot (package = rms) that is
really a lattice plot (class="trellis"). It is similar to this plot
produced by a very minor modification of the first example on the
bplot help page:
requiere(rms)
n <- 1000 # define sample size
set.seed(17) # so can reproduce the results
age <- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120,
2010 Aug 13
2
Lattice xyplots plots with multiple lines per cell
Hello,
I need to plot the means of some outcome for two groups (control vs
intervention) over time (discrete) on the same plot, for various subsets
such as gender and grade level. What I have been doing is creating all
possible subsets first, using the aggregate function to create the means
over time, then plotting the means over time (as a simple line plot with
both control & intervention
2005 Oct 31
2
Help with try or tryCatch
I am having trouble with try and tryCatch.
I have read the documentation but I just don't get it.
Here is what I am trying to do. I am testing a function which has a number
of parameters. I want to test it for different values of the parameters
and I have some loops, in the middle of which is a test of the function.
Sometimes the routine fails and so I have put the bit that might fail
2003 Jan 10
1
Creating packages
I am trying to create a package. I have succeeded in running R CMD check
and R CMD build on an Intel box running Redhat. I would now like to
build it on Windows as well. There is no compiled code in the package at
all.
I have downloaded the tools from Brian Ripley's Building R for Windows
page, and installed Active Perl 5.8.0. I have set paths, and Rcmd and the
tools are being found ok. I am
2003 Jun 23
1
precision matrix for polynomial growth curves
What does the warning message
"1: Singular precision matrix in level -1, block 1" mean?
I get this warning 50+ times when I try to fit the following
model
lme( response ~ covariateA + poly(covariateB,3), ~poly(covariateB,3)|group )
It's not a small dataset - a set of up to 20 blood pressure
readings on just over 2000 people, and I don't get the error
message when I try to fit
2004 Sep 30
1
nlme: cannot allocate vector of size 126064 Kb
I have around 4000 observations of a time series. I am trying to fit a
regression with ARMA error structure using gls from the package nlme.
I have encountered the error: cannot allocate vector of size 126064 Kb
I know this has come up many times before and I will check out the
suggestions in the mail archive. I was wondering though if there is an
alternative package that will fit such a
2010 Jun 28
2
Lattice and Beamer
Two things I think are some of the best developments in statistics and production are the lattice package and the beamer class for presentation in Latex. One thing I have not become very good at is properly sizing my visuals to look good in a presentation.
For instance, I have the following code that creates a nice plot (sorry, cannot provide reproducible data).
2006 Feb 11
1
Errors using update.packages()
When trying to update packages after the sysadmin updated R on my unix box
I got errors on some packages. For example for chron:
* DONE (chron)
mkdir: cannot create directory `/usr/lib/R/library/00LOCK': Permission
denied
ERROR: failed to lock directory '/usr/lib/R/library' for modifying
I got similar messages for spatial and cluster and warnings for other
packages. Finally I got: