Displaying 20 results from an estimated 10000 matches similar to: "xyplot plot with groups"
2007 Jan 25
1
summary of the effects after logistic regression model
Dear all, my aim is to estimate the efficacy over time of a treatment for
headache prevention. Data consist of long sequences of repeated binary
outcomes (1 if the subject has at least 1 episode of headache , 0
otherwise) on subjects randomized to placebo or treatment.
I have fit a logistic regression model with Huber-White cluster sandwich
covariance estimator.
I have put in the model the
2007 Nov 09
2
wrapper for coxph with a subset argument
Dear R-help -
Thanks to those who replied yesterday (Christos H. and Thomas L.)
regarding my question on coxph and model formula, the answers worked
perfectly.
My new question involves the following.
I want to run several coxph models (package survival) with the same
dataset, but different subsets of that dataset.
I have found a way to do this, described below in functions subwrap1 and
2012 May 29
2
use xyplot to plot mean and CI by groups
Dear R users,
I am trying to use xyplot to draw group mean and CI. The following is the
sample code. But I want:
1. Use different colors and symbols to draw individual points, CI and
the lines connect group means from different time points;
2. Add jitters to x axis to allow CIs not be overlapped
Could anyone modify the attached code to achieve this?
Thanks
library(lattice)
2010 Sep 07
2
some questions about longitudinal study with baseline
Hi all,
I asked this before the holiday, didn't get any response. So would like to
resend the message, hope to get any fresh attention. Since this is not purely
lme technical question, so I also cc-ed R general mailing list, hope to get some
suggestions from there as well.
I asked some questions on how to analyze longitudinal study with only 2 time
points (baseline and a follow-up)
2007 Jul 30
1
A simple question about summary.glm
Hello,
I am new to R and have tried to search similar questions but could not find
exactly what I am looking for, but I apologize if the question was already
asked.
I have 10 different treatments and want to know whether they affect the sex
ratios of insect emergence. After running the glms I got this table:
Df Deviance Resid. Df Resid. Dev F Pr(>F)
NULL
2009 Jan 04
1
Lattice xyplot help please.
Hi -
I am not R expert and I would appreciate your time if you can help me
about my xyplot question.
I would like to add text (p-value) in a 4 panels xyplot. I thought
panel = function{} should work but I am not sure where I did it wrong.
The error message from the following code is
"Argument subscripts is missing with no default values"
xyplot(GLG ~ PD | factor(TRT) , groups =
2010 Mar 03
1
Zero inflated negative binomial
Hi all,
I am running the following model:
> glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro)
where Year has 3 levels, Trt has 2 levels and Micro has 3 levels.
However when I run it has a zero inflated negative binomial (as I have lots
of zeros) I get the below error message:
> Zinb <- zeroinfl(AvGUD ~ Year*Trt*Micro |1, data = AvGUD89, dist =
"negbin")
Error in optim(fn =
2012 Jan 13
1
plotting regression line in with lattice
#Dear All,
#I'm having a bit of a trouble here, please help me...
#I have this data
set.seed(4)
mydata <- data.frame(var = rnorm(100),
temp = rnorm(100),
subj = as.factor(rep(c(1:10),5)),
trt = rep(c("A","B"), 50))
#and this model that fits them
lm <- lm(var ~ temp * subj, data = mydata)
#i want to
2009 Jul 28
5
Summarising Data for Forrest Plots
I tried to post this a few times last week and it seems to have got stuck somehow so I'm trying from a different email in the hope that works. If somehow this has appeared on the list 20 tiems and I never saw any of them I apologize ;-)
I'm basically an R-newbie. But I am VERY computer literate. But this has me stumped...
All the examples for using the rmeta package to create a
2010 Jun 22
2
xyplot: adding pooled regression lines to a paneled type="r" plot
Consider the following plot that shows separate regression lines ~ age
for each subject in the Pothoff-Roy Orthodont data,
with separate panels by Sex:
library(nlme)
#plot(Orthodont)
xyplot(distance ~ age|Sex, data=Orthodont, type='r', groups=Subject,
col=gray(.50),
main="Individual linear regressions ~ age")
I'd like to also show in each panel the pooled OLS
2011 Mar 07
1
XYPLOT - GROUPING WITH TWO CATEGORICAL VARIABLES
Hi! I have a dataframe like this:
dat=data.frame(Age=c(rep(30,8),rep(40,8),rep(50,8)),Period=rep(seq(2005,2008,1),3),Rate=c(seq(1,8,1),seq(9,16,1),seq(17,24,1)),Sex=rep(c(rep(0,4),rep(1,4)),3))attach(dat)dat
Age Period Rate Sex1 30 2005 1 02 30 2006 2 03 30 2007 3 04 30 2008 4 05 30 2005 5 16 30 2006 6 17 30 2007 7 18 30 2008
2007 May 17
1
MICE for Cox model
R-helpers:
I have a dataset that has 168 subjects and 12 variables. Some of the
variables have missing data and I want to use the multiple imputation
capabilities of the "mice" package to address the missing data. Given
that mice only supports linear models and generalized linear models (via
the lm.mids and glm.mids functions) and that I need to fit Cox models, I
followed the previous
2007 Aug 02
1
Xyplot - adding model lines to plotted points
Hello,
I have written code to plot an xyplot as follows:
library(lattice)
xyplot(len~ageJan1|as.factor(cohort),groups=sex,as.table=T,strip=strip.c
ustom(bg='white',fg='white'),data=dat,
xlab="Age (January 1st)",ylab="Length (cm)",main="Linear models for male
and female cod, by cohort",type='p',
2011 Jun 23
3
help- subtitles for multiple charts
Hello, I have a problem with my script. I don'y know how to apply subtitles.
I have 9 charts per page (for combination of 3 blocks and 3 treatments). I
want to have subtitles for this interaction (e.g. Block A Trt 1, Block A Trt
2, ...)
MBE$bt<- interaction(MBE$Block,MBE$trt)
par(mfrow=c(3,3))
for(i in unique(MBE$bt)){
ss <- MBE$bt==i
plot(MBE$Year[ss], MBE$DBH[ss])
2008 May 30
1
Question about adding text to xYplot(Hmisc)
Hello,
I have been trying to make a graph that have error bars and text at
specific position.
I used the following code from the help file of xYplot(Hmisc) as an
example except I add a myPanel function, which is just supposed to add
letters from the alphabet at the position aligned at y = 3.
It constantly gives me error:
"Error using packet 1 argument "subscripts" is
2010 Jul 02
1
xyplot: key inside the plot region / lme: confidence bands for predicted
I have two questions related to plotting predicted values for a linear
mixed model using xyplot:
1: With a groups= argument, I can't seem to get the key to appear
inside the xyplot. (I have the Lattice book,
but don't find an example that actually does this.)
2: With lme(), how can I generate confidence bands or prediction
intervals around the fitted values? Once
I get them, I'd
2011 Feb 08
2
Plot where points are treatment letter
I would like to create a plot of y vs x with different treatments where the
points are actually the letter of the treatment. Here is the code:
A<-as.matrix(rnorm(10,10))
B<-as.matrix(rnorm(10,9.5))
C<-as.matrix(rnorm(10,10.5))
Y<-as.matrix(rnorm(30,13))
X<-rbind(A,B,C)
nA<-matrix("A",10,1)
nB<-matrix("B",10,1)
nC<-matrix("C",10,1)
2007 Aug 11
1
xyplot() with segments() superposed?
In the hypothetical example below, how do I add two segments() into
the two panels, respectively? Say segments(x0=5, y0=10, x1=5, y1=20)
on the left and segments(x0=15, y0=-10, x1=15, y1=-2) on the right?
Many thanks in advance,
Yuelin Li.
ps. part of the code came from a solution given by Deepayan Sarkar.
-------------------
library(lattice)
set.seed(12345)
x <- 0:20
y.male.obs <- - 1.2
2005 Mar 03
0
Baffled by drop1
I've been experimenting with drop1 for my biostatistics class, to obtain the
so-called Type III sums of squares. I am fully aware of the deficiencies of
this method, however I feel that the students should be familiar with it.
What I find baffling is that when applied to a fully balanced design, you
obtain different sums of squares. I've used this for several years in Splus
and R and never
2005 Mar 03
0
Baffled by drop1: Please ignore previous request!
My apologies to the list for sending this without adequate research. I have
found my answer; please ignore! Thanks.
I've been experimenting with drop1 for my biostatistics class, to obtain the
so-called Type III sums of squares. I am fully aware of the deficiencies of
this method, however I feel that the students should be familiar with it.
What I find baffling is that when applied to a fully