Re: [R] metafor package: study level variation

2012-09-10 Thread Jarrett Byrnes
University, P.O. Box 616 (VIJV1) 6200 MD Maastricht, The Netherlands +31 (43) 388-4170 | http://www.wvbauer.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jarrett Byrnes Sent: Friday, September 07, 2012 16:02 To: R

[R] metafor package: study level variation

2012-09-07 Thread Jarrett Byrnes
Hello. A quick question about incorporating variation due to study in the metafor package. I'm working with a particular data set for meta-analysis where some studies have multiple measurements. Others do not. So, let's say the effect I'm looking at is response to two different kinds of

[R] turning coefficients into an lm obect

2011-07-15 Thread Jarrett Byrnes
I'm working with a dataset and fitting and comparing various lms. I also have a fitted model parameter values and SE estimated from the literature. In doing my comparison, I'd like to turn these estimates into an lm object itself for ease of use with some of the code I'm writing. While

[R] multicore mclapply error

2010-08-12 Thread Jarrett Byrnes
I'm running r 2. on a mac running 10.6.4 and a dual-core macbook pro. I'm having a funny time with multicore. When I run it with 2 cores, mclapply, R borks with the following error. The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on

Re: [R] multicore mclapply error

2010-08-12 Thread Jarrett Byrnes
: On Thu, 12 Aug 2010, Jarrett Byrnes wrote: I'm running r 2. on a mac running 10.6.4 and a dual-core macbook pro. I'm having a funny time with multicore. When I run it with 2 cores, mclapply, R borks with the following error. The process has forked and you cannot use

[R] a question regarding updating formulas with coefficients

2010-08-11 Thread Jarrett Byrnes
I have formulae with coefficents that I would like to update. However, I get some strange results. For example, see the following: For the formula y ~ d+ 3*r+t I want to add a variable p, so update(y~d+0*r+t, .~.+p) produces y ~ d + t + p - 1 If the coefficient is not 0, but rather,

Re: [R] sem by variable x

2010-07-20 Thread Jarrett Byrnes
You may want to take a look at the lavaan package and use the multigroup analysis there (and see if you even need to group by country as well). Otherwise, you could do something like library(sem) library(plyr) cfa_func-function(a.df){ cfa-sem(ses.model, cov(a.df[,2:7], nrow(a.df)))

Re: [R] SEM interaction

2010-05-25 Thread Jarrett Byrnes
Have you looked into multigroup analysis? Is that what you're after? If so, you can do multigroup analysis in lavaan fairly easily or, if you're using the sem package, drop me a line. I have some scripts that will do multigroup analysis for an equal sample size. See

Re: [R] calculate response probabilities using sem-analysis

2010-03-22 Thread Jarrett Byrnes
Did you back-calculate to estimate an intercept? Alternately, I've been working on a function that takes a fitted sem and gets predicted values given an input. Contact me off-list and I'll send it to you. On Mar 22, 2010, at 8:37 AM, Tryntsje Wesselius wrote: Hi everyone, I just

Re: [R] SEM error

2010-02-22 Thread Jarrett Byrnes
I have often found this to happen if the scale of one variable is orders of magnitude different than the scale of other variables. Have you tried inspecting the covariance matrix and log transforming any such variables? On Feb 22, 2010, at 8:14 AM, Uwe Ligges wrote: On 20.02.2010

[R] suppress printing within a function

2010-02-16 Thread Jarrett Byrnes
to suppress such printing, say, within a loop or a ddply statement? Thanks! -Jarrett Jarrett Byrnes Postdoctoral Associate, Santa Barbara Coastal LTER Marine Science Institute University of California Santa Barbara Santa Barbara, CA 93106-6150 http

Re: [R] interpreting error estimate in SEM

2010-02-09 Thread Jarrett Byrnes
} Jarrett Byrnes Postdoctoral Associate, Santa Barbara Coastal LTER Marine Science Institute University of California Santa Barbara Santa Barbara, CA 93106-6150 http://www.lifesci.ucsb.edu/eemb/labs/cardinale/people/byrnes/index.html On Feb 9, 2010, at 4:17 AM, John Fox wrote: Dear Kathryn, I assume

Re: [R] Structural Equation Models(SEM)

2009-12-15 Thread Jarrett Byrnes
Joerg Everman has a great solution to this. He changed the middle of the sem.mod code to include a variable, fit, and then used the following approach around where you define the objectives: if (fit==ml) { objective.1 - function(par){ A - P - matrix(0, m, m) val -

Re: [R] Structural Equation Models(SEM)

2009-12-02 Thread Jarrett Byrnes
functions. One would only need an if statement. A little extra work might be needed to incorporate ADF methods, but it should not be intractable. Note, the sem package is on r-forge. -Jarrett Jarrett Byrnes Postdoctoral Associate, Santa Barbara Coastal

[R] adding points to a wireframe

2009-08-18 Thread Jarrett Byrnes
A quick question. I'm trying to plot a surface from a fitted model along with the original points, as in the following example: df-data.frame(expand.grid(100*runif(1:100), 100*runif(1:100))) df$Var3-rnorm(length(df$Var1), mean=df$Var1*df$Var2, sd=10) my.lm-lm(Var3 ~ Var1*Var2, data=df)

[R] using ddply but preserving some of the outside data

2009-08-05 Thread Jarrett Byrnes
I have a bit of a quandy. I'm working with a data set for which I have sampled sites at a variety of dates. I want to use this data, and get a running average of the sampled values for the current and previous date. I originally thought something like ddply would be ideal for this,

Re: [R] Another SEM question

2009-07-21 Thread Jarrett Byrnes
Z - Z sem.mod - sem(model, mod.cov, N=109) summary(sem.mod) All vectors have a length of 109. Thank you for your help once again. Best wishes, Luba -Urspr?ngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] Im Auftrag von Jarrett Byrnes

Re: [R] Another SEM question

2009-07-21 Thread Jarrett Byrnes
. Thanks a lot for your help, Luba -Urspr?ngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] Im Auftrag von Jarrett Byrnes Gesendet: Dienstag, 21. Juli 2009 08:19 An: Stein, Luba (AIM SE) Cc: r-help@r-project.org Betreff: Re: [R] Another SEM question

Re: [R] Another SEM question

2009-07-21 Thread Jarrett Byrnes
...@r- project.org] Im Auftrag von Stein, Luba (AIM SE) Gesendet: Dienstag, 21. Juli 2009 09:13 An: Jarrett Byrnes Cc: r-help@r-project.org Betreff: Re: [R] Another SEM question Hello, Perhaps this is a good point. I use the Eclipse platform. The problem was that when I first used the structure Z

Re: [R] Another SEM question

2009-07-20 Thread Jarrett Byrnes
Luba, If you could provide the code you ran, perhaps the listserv can be of help. On Jul 20, 2009, at 7:55 AM, Stein, Luba (AIM SE) wrote: Hello, I use the function sem the following way sem.mod - sem(model, mod.cov, N=109) where the variables are modelled: Z - M Z - I Z - R M - M I -

[R] altering a global variable

2009-06-15 Thread Jarrett Byrnes
I wanted globally? Thanks for any pointers! -Jarrett Jarrett Byrnes Postdoctoral Associate, Santa Barbara Coastal LTER Marine Science Institute University of California Santa Barbara Santa Barbara, CA 93106-6150 http://www.lifesci.ucsb.edu/eemb/labs

Re: [R] SEM/path question

2009-05-30 Thread Jarrett Byrnes
I've enjoyed Jim Grace's Structural Equation Modeling and Natural Systems http://www.amazon.com/Structural-Equation-Modeling-Natural-Systems/dp/0521546532/ref=sr_1_2?ie=UTF8s=booksqid=1243719710sr=8-2 as well as Rex Kline's Principles and Practice of Structural Equation Modeling

Re: [R] CFA in R/sem package

2009-04-09 Thread Jarrett Byrnes
Ivan, I recently put together the sem.additions package over at R forge in part for just such a multiple model problem. THere are a variety of methods that make it easy to add/delete links that could be automated with a for loop and something from the combn package, I think.

Re: [R] CFA in R/sem package

2009-04-09 Thread Jarrett Byrnes
: install.packages(sem.additions, repos=http://R-Forge.R- project.org) Warning message: package ‘sem.additions’ is not available Best, Iuri. On Thu, Apr 9, 2009 at 3:10 PM, Jarrett Byrnes byr...@msi.ucsb.edu wrote: Ivan, I recently put together the sem.additions package over at R forge in part

Re: [R] CFA in R/sem package

2009-04-09 Thread Jarrett Byrnes
? Making (using my example) 4 different models, one for each construct, then use combine.models and add.to.models to create the 12 models to be compared? Best, Iuri. On Thu, Apr 9, 2009 at 8:13 PM, Jarrett Byrnes byr...@msi.ucsb.edu wrote: install.packages(sem-additions,repos=http://R-Forge.R

Re: [R] Ryan's Q Post-Hoc for ANOVA

2008-11-21 Thread Jarrett Byrnes
I realize this is a little late, but I recently ended up rolling my own Ryan's Q in R. If anyone is interested, or wishes to make improvements, you can find it here: http://homes.msi.ucsb.edu/~byrnes/r_files/ryans_q.r On Oct 25, 2005, at 10:15 AM, Jarrett Byrnes wrote: I'm using lm

[R] Displaying Equations in Documentation

2008-08-25 Thread Jarrett Byrnes
I'm currently working on writing up some documentation for some of my code, but am having the darndest time coding in equations. For example, the equation in the following: \details{ Calculated the R Squared for observed endogenous variables in a structural equation model, as well as

[R] question about se of predicted glm values

2008-05-05 Thread Jarrett Byrnes
) -Jarrett Jarrett Byrnes Population Biology Graduate Group, UC Davis Bodega Marine Lab 707-875-1969 http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml [[alternative HTML version deleted

[R] glht with a glm using a Gamma distribution

2008-04-14 Thread Jarrett Byrnes
p values reported) -Jarrett Jarrett Byrnes Population Biology Graduate Group, UC Davis Bodega Marine Lab 707-875-1969 http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml [[alternative HTML version deleted

[R] manova with non-normal error distribution

2008-03-13 Thread Jarrett Byrnes
get the error Error: (subscript) logical subscript too long Is there a library or method of analysis that handles this type of problem? Much obliged! -Jarrett Jarrett Byrnes Population Biology Graduate Group, UC Davis Bodega Marine Lab 707-875-1969

[R] Asking, are simple effects different from 0

2008-03-04 Thread Jarrett Byrnes
Hello, R-i-zens. I'm working on an data set with a factorial ANOVA that has a significant interaction. I'm interested in seeing whether the simple effects are different from 0, and I'm pondering how to do this. So, I have my.anova-lm(response ~ trtA*trtB) The output for which gives me a

[R] difference between lme and lmer in df calculation

2008-02-17 Thread Jarrett Byrnes
Hello all. I'm currently working with mixed models, and have noticed a curious difference between the nlme and lmer packages. While I realize that model selection with mixed models is a tricky issue, the two packages currently produce different AIC scores for the same model, but they

[R] extracting AIC scores from lmer and other objects

2008-02-04 Thread Jarrett Byrnes
, I'm guessing there's a more general issue here that I'm missing. Any pointers? Thanks! -Jarrett Jarrett Byrnes Population Biology Graduate Group, UC Davis Bodega Marine Lab 707-875-1969 http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml