Re: [R] metafor package: study level variation

2012-09-10 Thread Jarrett Byrnes
> Faculty of Health, Medicine, and Life Sciences > Maastricht 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] 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 drug

[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 puttin

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. >> >>

[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

[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, somet

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 http://faculty.chass.ncsu

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 conducte

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 08:51

[R] suppress printing within a function

2010-02-16 Thread Jarrett Byrnes
ay 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

Re: [R] interpreting error estimate in SEM

2010-02-09 Thread Jarrett Byrnes
nce", "R^2", "Standardized.Error.Coefficient") output.matrix } 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

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
iscrepancy 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, San

[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) m

[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, howe

Re: [R] Another SEM question

2009-07-21 Thread Jarrett Byrnes
help-boun...@r-project.org [mailto:r-help-boun...@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 pr

Re: [R] Another SEM question

2009-07-21 Thread Jarrett Byrnes
ble Z ->M. 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

Re: [R] Another SEM question

2009-07-20 Thread Jarrett Byrnes
hricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] Im Auftrag von Jarrett Byrnes Gesendet: Montag, 20. Juli 2009 18:25 An: Stein, Luba (AIM SE) Cc: r-help@r-project.org Betreff: Re: [R] Another SEM question Luba, If you could provide the code you ran, perhaps the li

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 <->

[R] altering a global variable

2009-06-15 Thread Jarrett Byrnes
tually set m to whatever value 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://w

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=UTF8&s=books&qid=1243719710&sr=8-2 as well as Rex Kline's Principles and Practice of Structural Equation Modeling http:

Re: [R] CFA in R/sem package

2009-04-09 Thread Jarrett Byrnes
oach you suggest? 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 wrote: install.packages("sem-additions",repos="

Re: [R] CFA in R/sem package

2009-04-09 Thread Jarrett Byrnes
vronski wrote: Jarret, Look: 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 wrote: Ivan, I recently put together the sem.ad

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. http://r-for

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 u

[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 sever

[R] question about se of predicted glm values

2008-05-05 Thread Jarrett Byrnes
, c(a.fit$fit+a.fit$se.fit, b.fit$fit+b.fit$se.fit)) lines(0:3,rep(0,4), lty=2) -Jarrett Jarrett Byrnes Population Biology Graduate Group, UC Davis Bodega Marine Lab 707-875-1969 http://www-eve.ucdavis.ed

[R] glht with a glm using a Gamma distribution

2008-04-14 Thread Jarrett Byrnes
stimate Std. Error z value p value A v. B == 0 1.9646 0.6201 3.168 0.00314 ** A v. C == 0 1.6782 0.6201 2.706 0.01545 * A v. D == 0 2.1284 0.6201 3.433 0.00137 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Adjusted p values reported) -Jarrett --

[R] manova with non-normal error distribution

2008-03-13 Thread Jarrett Byrnes
nse variable, I 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 L

[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 syst

[R] extracting AIC scores from lmer and other objects

2008-02-04 Thread Jarrett Byrnes
Error in UseMethod("logLik"). Given that this is true either for lm, glm, or lmer objects, I'm guessing there's a more general issue here that I'm missing. Any pointers? Thanks! -Jarrett Jarrett Byrnes Population Biology G