Displaying 20 results from an estimated 2000 matches similar to: "color lines by group membership in spaghetti plot"
2012 Apr 04
3
spaghetti plots in R
I would like to plat some spaghetti plots from my data , ma data is as
follows
ak[1:3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[,8] [,9]
[1,] 0.3211745 0.4132568 0.5649930 0.6920562 0.7760113 0.8118568 0.8609301
0.9088819 0.9326736
[2,] 0.3159234 0.4071270 0.5579212 0.6844584 0.7684690 0.8243702 0.8677043
0.8931288 0.9261926
[3,] 0.3075260 0.3993699
2011 Sep 03
1
Problem with by statement for spaghetti plots
Hi,
I am trying to apply the example at the bottom of the following page to my
own data:
http://128.97.141.26/stat/R/faq/spagplot.htm
http://128.97.141.26/stat/R/faq/spagplot.htm
The code from the example is:
/tolerance<-read.table("http://www.ats.ucla.edu/stat/R/faq/tolpp.csv",sep=",",
header=T)
fit <- by(tolerance, tolerance$id,function(x) fitted.values(lm(tolerance
2012 Jan 24
0
spaghetti plot - categorical variable differentiated by color
Hello,
I am trying to create individual concentration-time spaghetti plots sorted
by dose, and within each dose to show two different colors for a
categorical variable (gender). I can’t find a way to add the color for
gender. Groups=ID enables individual lines for each subject. If I use
groups=gender, there will be two colors, but the lines between subjects are
connected.
This is what I have
2017 Jul 19
0
spaghetti plot - urgent
Hi Rosa,
You pass a vector to ggplot, which expects a data.frame. I am sure you
meant to do this:
point7$y_point7 <- point7$beta0_7 + point7$beta1_7*point7$time + point7
$epsilon_7
ggplot(point7, aes(time, y_point7)) + geom_line()
HTH
Ulrik
On Wed, 19 Jul 2017 at 20:37 Rosa Oliveira <rosita21 at gmail.com> wrote:
> Hi everyone,
>
> I?m trying to do a spaghetti plot and I
2017 Jul 19
2
spaghetti plot - urgent
Hi everyone,
I?m trying to do a spaghetti plot and I know I?m doing all wrong, It must be.
What I need:
15 subjects, each with measurements over 5 different times (t1, ..., t5), and the variable that I need to represent in the spaguetti plot is given by:
PCR = b0 + b1 * ti + epsilon
B0, - baseline of each subject
B1 - trajectory of each subject over time (so multiply by t)
Epsilon - error
2013 Apr 30
0
Grouped spaghetti plots in multipanel graphs
Dear Rxperts,
Is there a simpler way to generate multipanel grouped individual profile
plots? All individuals of a group within a panel have the same color. As
of now I am using lattice::xyplot to get the desired effect. Please feel
free to suggest other ideas.
Also, I am trying to create a generalized function which goes on similar
lines like this..
grpPlot <- function(dat, mpgrp=quote(G),
2008 Jul 18
2
column wise paste of data.frames
Hi everybody!
I'm sure that I overlook something and feel quite stupid to ask, but I
have not found an easy solution to the following problem: Take e.g. the
Orthodont data from the nlme package:
> head(Orthodont)
Grouped Data: distance ~ age | Subject
distance age Subject Sex
1 26.0 8 M01 Male
2 25.0 10 M01 Male
3 29.0 12 M01 Male
4 31.0 14 M01 Male
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 Feb 28
3
Measuring correlations in repeated measures data
R-helpers:
I would like to measure the correlation coefficient between the repeated measures of a single variable that is measured over time and is unbalanced. As an example, consider the Orthodont dataset from package nlme, where the model is:
fit <- lmer(distance ~ age + (1 | Subject), data=Orthodont)
I would like to measure the correlation b/t the variable "distance" at
2009 Mar 16
1
Please help! How do I change the class of a numeric variable in a grouped data object to a factor?
Hi all
I’m in desperate need of help. I’m working with a grouped data object, called Orthodont in the nlme package in R, and am trying to fit various models (learning methods for my thesis), but one of the variables in the object is numeric, (age) and I need it to be a factor. I’ve tried: as.factor(Orthodont$age)
as.factor(as.character(Orthodont$age))
and various other things, but when I then
2006 Jun 28
3
lme convergence
Dear R-Users,
Is it possible to get the covariance matrix from an lme model that did not converge ?
I am doing a simulation which entails fitting linear mixed models, using a "for loop".
Within each loop, i generate a new data set and analyze it using a mixed model. The loop stops When the "lme function" does not converge for a simulated dataset. I want to
2010 Jul 15
4
Sweave: infelicities with lattice graphics
In a paper I'm writing using Sweave, I make use of lattice graphics, but
don't want to explicitly show (or explain)
in the article text the print() wrapper I need in code chunks for the
graphs to appear.
I can solve this by including each chunk twice, with different options,
as in
<<ortho-xyplot1-code, keep.source=TRUE, eval=FALSE>>=
library(nlme)
library(lattice)
2008 May 09
1
Using lme() inside a function
Dear R-help
I'm working on a large dataset which I have divided into 20 subsets
based on similar features. Each subset consists of observations from
different locations and I wish to use the location as a random effect.
For each group I want to select regressors by a stepwise procedure and
include a random effect on the intercept. I use stepAIC() and lme().
(The lmer()-function doesn't
1999 Jul 01
1
lme
I am using rw0641.
In my continuing quest to understand repeated measures analysis, I again
return to lme. I exported the Potthoff and Roy data Orthodont.dat from
S-PLUS 4.5 to avoid capture errors and ran the examples in the R help. I
imported the data.frame with
data <- read.table("Orthodont.dat",header=T)
attach(data)
and created the objects
Orthodont.fit1 <-
2006 Sep 07
5
augPred plot in nlme library
All,
I'm trying to create an augPred plot in the nlme library, similar to the
plot on
p.43 of Pinheiro & Bates (Mixed Effects Models in S and S-Plus) for
their Pixel data.
My data structure is the same as the example but I still get the error
msg below.
> comp.adj.UKV <- groupedData(adj.UKV ~ Time | Patient_no/Lisinopril,
data = comp.adj.UKV.frm, order.groups = F)
>
2002 Dec 17
1
lme invocation
Hi Folks,
I'm trying to understand the model specification formalities
for 'lme', and the documentation is leaving me a bit confused.
Specifically, using the example dataset 'Orthodont' in the
'nlme' package, first I use the invocation given in the example
shown by "?lme":
> fm1 <- lme(distance ~ age, data = Orthodont) # random is ~ age
Despite the
2008 May 09
2
How can one make stepAIC and lme
Dear R-help
I'm working on a large dataset which I have divided into 20 subsets based on similar features. Each subset consists of observations from different locations and I wish to use the location as a random effect.
For each group I want to select regressors by a stepwise procedure and include a random effect on the intercept. I use stepAIC() and lme(). (The lmer()-function doesn't
2003 Mar 04
2
How to extract R{i} from lme object?
Hi, lme() users,
Can some one tell me how to do this.
I model Orthodont with the same G for random
variables, but different R{i}'s for boys and girls, so
that I can get sigma1_square_hat for boys and
sigma2_square_hat for girls.
The model is Y{i}=X{i}beta + Z{i}b + e{i}
b ~ iid N(0,G) and e{i} ~ iid N(0,R{i}) i=1,2
orth.lme <- lme(distance ~ Sex * age, data=Orthodont,
random=~age|Subject,
2004 Aug 27
2
degrees of freedom (lme4 and nlme)
Hi, I'm having some problems regarding the packages
lme4 and nlme, more specifically in the denominator
degrees of freedom. I used data Orthodont for the two
packages. The commands used are below.
require(nlme)
data(Orthodont)
fm1<-lme(distance~age+ Sex,
data=Orthodont,random=~1|Subject, method="REML")
anova(fm1)
numDF DenDF F-value p-value
(Intercept) 1
2018 Sep 20
3
A different error in sample()
Good day,
The use of "rounding" also doesn't make sense. If The number is halfway between two integers, it is rounded to the nearest even integer.
> round(2.5)
[1] 2
--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia