Could somebody look at this? I'm new to ggplot, so any help would be greatly
appreciated. I provided an example to facilitate. Thanks!
dadrivr wrote
>
> I'm fitting a lme growth curve model with two predictors and their
> interaction as predictors. The multilevel mode
I'm fitting a lme growth curve model with two predictors and their
interaction as predictors. The multilevel model is nested so that level 1 is
time within the individual, and level 2 is the individual. I would like to
plot the mean group-level trajectories at plus and minus 1 SD from the mean
of
I'm trying to make correlograms using corrgram. See below for a simple
example.
library(corrgram)
data(baseball)
vars1 <- c("Assists","Atbat","Errors","Hits","Homer","logSal")
vars2 <- c("Putouts","RBI","Runs","Walks","Years")
corrgram(baseball[,vars2],lower.panel=panel.shade, upper.panel=
I completely agree that the development of full-information maximum
likelihood (FIML) estimation for use in packages like lm, lme, lmer, etc.
would make R much more attractive. FIML is better than other approaches to
missing data (e.g., multiple imputation; see Graham, Olchowski, & Gilreath,
2007)
Hi,
I have a string that I want to use in a variable call. How can I remove the
quotes and/or the string properties of the string to use it in a variable
call?
Here's an example:
library(lme)
fm2 <- lme(distance ~ age, data = Orthodont, random = ~ 1)
summary(fm2)
I want to update the above reg
I am fitting individual growth models using nlme (multilevel models with
repeated measurements nested within the individual), and I am trying to
calculate the Pseudo R-squared for the models (an overall summary of the
total outcome variability explained). Singer and Willett (2003) recommend
calcul
Hi,
I want to impute a data set multiple times with Amelia, but the data set is
large so it takes a long time. As a result, I'm trying to run the multiple
imputation with parallel processors in Windows, but am having trouble. Here
is a quick example:
##
library(foreach)
library(doSNOW)
regi
How do I subset data to only keep those rows of a dataframe where a
variable's value matches one item of a vector. For example, how do I keep
all of the rows (and all variables) where mydata$id equals one of the values
in keepid? See below?
mydata <- NULL
mydata$id <- 1:30
mydata$value <- seq(fr
1,2,2)
> mydata <- as.data.frame(cbind(id,age,outcome))
> interaction.plot(mydata$age, mydata$id, mydata$outcome, fun = mean, legend
> = FALSE, lty = 1, xtick = TRUE, type = "l")
>
> How can I make the 'mean' summary line red and thicker?
David Winsemius
David Winsemius wrote:
> What "mean summary line"? I count 8 lines and that matches the number
> if id's with complete data.
Yea, I don't know why there is no mean summary line showing up. I requested
it in the interaction.plot statement (fun = mean), and I don't get any
errors. Any ideas?
-
Here's an example:
/id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24,
24,24,25,25,25,26,26,26)
age <- rep(c(30,36,42),10)
outcome <-
c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20,
14,16,1,2,2)
mydata <- as.data.frame(cbind(id,age,ou
Sorry, I thought the link would work for people because it is a public link
and it works for me when I run it in R. Anyways, here is an example set of
data that I am having trouble with:
/id <-
c(230017,230017,230017,230018,230018,230018,230019,230019,230019,230020,230020,
230020,230021,2
Hi,
I'm trying to reshape my data set from wide to tall format for multilevel
modeling. Unfortunately, the function I typically use (make.univ from the
multilevel package) does not appear to work with unbalanced data frames,
which is what I'm dealing with.
Below is an example of the columns of a
Can anybody help me with this?
--
View this message in context:
http://r.789695.n4.nabble.com/Change-properties-of-line-summary-in-interaction-plot-tp3788614p3796133.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Bump, please help!
--
View this message in context:
http://r.789695.n4.nabble.com/Problem-with-by-statement-for-spaghetti-plots-tp3788536p3796131.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https:/
Is it possible to change the color/thickness of the summary line in an
interaction.plot without changing the other individual data lines? I would
like to make the line from the summary function (mean) the color red and
thicker than the surrounding black lines. How can I do that?
Here is a link t
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=
Thanks guys,
I had to change two things to get it to work:
1. As Dennis pointed out, all of the variables in the model had to be
variable names in the preds data frame.
2. I had to use na.pass in the following statement to be able to merge the
predicted values with the preds data frame because of
Thanks Dennis,
The code works for perfectly for the data in the example. For some reason,
however, I get the following error message when I use a different data set:
> preds <- expand.grid(age = c(30,36,42), Subject = unique(mydata$id))
> predict(lmemodel, preds, na.action=na.omit)
Error in pr
Hi Dennis,
That's very helpful. The plot appears appears to be of the data and not the
fitted linear trajectories, however, as the lines are not linear. Is it
possible to plot the fitted linear trajectories (according to the
fixed/random intercepts and slopes of the lme model)?
Thanks again!
-
Hi all,
I am trying to plot the fitted trajectories for each individual from an
individual growth model (fit with a linear mixed effects model in lme). How
can I plot each person's trajectory in the *same* panel, along with the
mean-level trajectory?
Below is an image of a plot similar to what
Thanks for all the suggestions, guys. It looks like TIFF may be the easiest
solution, as I wouldn't have to worry about printing to a postscript printer
or converting to PDF (when using EPS). That way, I could send the Word file
as is to all coauthors (important for collaboration - i.e., track c
Thanks for your help, guys. I'm looking to produce a high-quality plot (no
jagged lines or other distortions) with a filetype that is accepted by
Microsoft Word on a PC and that most journals will accept. That's why I'd
prefer to stick with JPEG, TIFF, PNG, or the like. I'm not sure EPS would
f
Hi everyone,
I am trying to make some publication-quality plots for use in Microsoft
Word, but I am having trouble creating high-quality plots that are supported
by Microsoft Word.
If I use the R plot function to create the figure, the lines are jagged, and
the picture is not of high quality (sa
Thanks everyone for the helpful ideas. It appears that this will be more
difficult than I thought. I don't necessary have an inclination toward
p-values, but many journals certainly do. I would be willing to try to
calculate the confidence intervals around the estimates, but I haven't
gotten an
By the way, my concern with lmer and glmer is that they don't produce
p-values, and the techniques used to approximate the p-values with those
functions (pvals.fnc, HPDinterval, mcmcsamp, etc.) only apply to Gaussian
distributions. Given that I would likely be working with quasi-poisson
distribut
I am using a multilevel modeling approach to model change in a person's
symptom score over time (i.e., longitudinal individual growth models). I
have been using the lme function in the multilevel package for the analyses,
but my problem is that my outcome (symptoms) and one of my predictors
(even
I am trying to plot an interaction in a multilevel model. Here is some
sample data. In the following example, it is longitudinal (i.e., repeated
measures), so the outcome, score (at each of the three time points), is
nested within the individual. I am interested in the interaction between
gende
I am trying to reshape a data set. Could someone please help me with the
reshape, cast, and melt functions? I am new to R and I have tried reading
up on how to use the reshape package, but I am very confused. Here is an
example of what I am trying to do:
subject coder score time
[1,]
and SPSS. Any ideas why I'm getting different values? Is something wrong
with my formula in R? Any help would be greatly appreciated. Thanks!
Peter Ehlers wrote:
>
>
> dadrivr wrote:
>> The variables have the same length, but with different numbers of missing
>>
I am trying to export a data frame to SPSS. I am using write.foreign to
export the .txt data file and the .sps SPSS syntax file to read the .txt
file into SPSS. I am running into problems because my data set includes
variable names that are longer than 8 characters, and the write.foreign
functio
dd in the predictors, e.g.
> residuals(lm(y ~ z1 + z2))
>
> -Ista
>
> On Wed, Nov 11, 2009 at 10:34 PM, dadrivr wrote:
>>
>> Awesome, that's what I was looking for. I have two additional questions:
>> (1)
>> What can I do if the variables are of differe
t lengths? I get an
error when calculating the residuals.
(2) control for z and a (i.e., more than one variable)?
Thanks so much for your help.
Peter Ehlers wrote:
>
>
> dadrivr wrote:
>> I'm trying to write code to calculate partial correlations (along with
>> p-values)
I'm trying to write code to calculate partial correlations (along with
p-values). I'm new to R, and I don't know how to do this. I have searched
and come across different functions, but I haven't been able to get any of
them to work (for example, pcor and pcor.test from the ggm package).
In the
to use:
>
> task[[i]]
>
> instead of task[i]
>
> b
>
> On Nov 1, 2009, at 11:04 PM, dadrivr wrote:
>
>>
>> I would like to preface this by saying that I am new to R, so I
>> would ask
>> that you be patient and thorough, so that I'm not complete
I would like to preface this by saying that I am new to R, so I would ask
that you be patient and thorough, so that I'm not completely clueless. I am
trying to convert a list to numeric so that I can perform computations on it
(specifically mean-center the variable), but I am running into proble
36 matches
Mail list logo