[R] hurdle, simulated power

2011-05-04 Thread David Atkins
Hi all-- We are planning an intervention study for adolescent alcohol use, and I am planning to use simulations based on a hurdle model (using the hurdle() function in package pscl) for sample size estimation. The simulation code and power code are below -- note that at the moment the "powe

Re: [R] Ordinal mixed model

2010-09-23 Thread David Atkins
Patrick-- One other option in addition to Thierry's suggestion, within R you might also consider the ordinal package, which handles random-intercept models. That said, if you are used to SPSS, I suspect this will be a titanic pain trying to move to R (part. if just for this one analysis...).

Re: [R] Panel regression for zero-inflated count data with over-dispersion?

2010-08-13 Thread David Atkins
Steffen-- You might want to take a look at the MCMCglmm package by Jarrod Hadfield. It can run a zero-inflated overdispersed Poisson model with random-effects. (I realize you asked about a fixed-effects model, but MCMCglmm ought to functionally give you what you want -- an appropriate mode

Re: [R] Visualization of coefficients

2010-07-06 Thread David Atkins
FYI, there is already a function coefplot in the arm package; for example, compare: > library(arm) Loading required package: MASS Loading required package: Matrix [snip] Attaching package: 'arm' The following object(s) are masked from 'package:coda': traceplot > data("Mroz", package =

Re: [R] Mixed Effects Model on Within-Subjects Design

2010-05-19 Thread David Atkins
Dave-- Given that you want all comparisons among all means in your design, you won't get that directly in a call to lme (or lmer in lme4 package). Take a look at multcomp package and its vignettes, where I think you'll find what you're looking for. cheers, Dave -- Dave Atkins, PhD Research

Re: [R] Dropping "trailing zeroes" in longitudinal data

2010-04-26 Thread David Atkins
Seattle, WA 98104? 206-897-4210 http://www.chammp.org (Thurs) William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Atkins Sent: Monday, April 26, 2010 12:23 PM To: r-help@r-project.org Subject: [R] Dropping

[R] Dropping "trailing zeroes" in longitudinal data

2010-04-26 Thread David Atkins
Background: Our research group collected data from students via the web about their drinking habits (alcohol) over the last 90 days. As you might guess, some students seem to have lost interest and completed some information but not all. Unfortunately, the survey was programmed to "pre-popu

Re: [R] plotting RR, 95% CI as table and figure in same plot

2010-04-19 Thread David Atkins
hViewport(viewport(layout.pos.row = i, layout.pos.col = 2 * nc + 1, xscale = xrange)) if (is.summary[i]) drawSummaryCI(lower[i], mean[i], upper[i], info[i]) else drawNormalCI(lower[i], mean[i], upper[i], info[i]) popViewport() } popViewport() } Dav

[R] plotting RR, 95% CI as table and figure in same plot

2010-04-19 Thread David Atkins
Hi all-- I am in the process of helping colleagues write up a ms in which we fit zero-inflated Poisson models. I would prefer plotting the rate ratios and 95% CI (as I've found Gelman and others convincing about plotting tables...), but our journals usually like the numbers themselves. Thu

Re: [R] Robust estimation of variance components for a nested design

2010-03-13 Thread David Atkins
Sue-- Check out the heavy package on CRAN, which implements the robust mixed-effects models that Andy mentioned. The package is relatively new and is still being developed, but worth a look. cheers, Dave I believe Pinhiero et al published a paper in JCGS a few years back on the subject, m

Re: [R] question about warning message in nlme model

2007-11-29 Thread David Atkins
Hi Christine-- The problem (and error msg) arises because you have repeated measures nested in individuals and *exactly* two individuals in every couple. Your syntax below specifies a random intercept and slope, and implicitly, the covariance between those random-effects at the second (or ind