[R] Calculating between and within subject coefficient of variation

2017-03-30 Thread Alicia Ellis
Let's say I have repeated measures of some outcome on some subjects. I want to be able to calculate the within and between subject coefficient of variation for this measure. An example data frame is: df<-data.frame(ID = c(1,1,1,2,2,2,3,3,3), DAY = c(0,3,6, 0,3,6, 0,3,6),

Re: [R] Changing cell value for MANY unique pairings of values in 2 columns

2017-03-21 Thread Alicia Ellis
sem...@comcast.net> wrote: > > > On Mar 18, 2017, at 9:52 AM, David Winsemius <dwinsem...@comcast.net> > wrote: > > > > > >> On Mar 17, 2017, at 11:33 AM, Alicia Ellis <alicia.m.el...@gmail.com> > wrote: > >> > >> am cleaning some very messy he

[R] Changing cell value for MANY unique pairings of values in 2 columns

2017-03-18 Thread Alicia Ellis
am cleaning some very messy health record lab data. Several of the rows in the VALUE column have text entries and they need to be converted to numeric in the NUMERIC_VALUE column based on the values in VALUE and DESCRIPTION. For example: df <- data.frame(VALUE = c("<60", "Positive",

[R] p.adjust not working correctly?

2016-08-03 Thread Alicia Ellis
p.adjust for bonferroni p value correction does not appear to be working correctly: > p <- runif(50) > > p [1] 0.08280254 0.08955706 0.19754389 0.52812033 0.68907772 0.21849696 0.02774784 0.23923562 0.03482480 0.76437481 0.87236155 0.76438604 [13] 0.37432032 0.89630318 0.01626565 0.08152060

[R] no 'nobs' method available error when using BIC selection in glmulti with genetic algorithm and lmer

2014-03-25 Thread Alicia Ellis
* wealth.factor_scaled* time.water_scaled_sqrt* drink.water* urban.rural, data=mydata, level = 1, fitfunc = lmer.glmulti, random = +(1|country.code/year/cluster), method = g, imm = 0.5, crit = bic, confsetsize = 16384) -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University

[R] Fwd: Error with glmulti

2014-03-18 Thread Alicia Ellis
THE NEGATIVE LENGTH VECTORS ERROR IF WE INCLUDE HOUSEHOLD NESTED WITHIN THE OTHER RANDOM FACTORS FOR GLMULTI BUT NOT FOR LMER? ANY SUGGESTIONS FOR WHAT WE CAN DO TO DIAGNOSE OR FIX THE PROBLEM? Thanks! -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University of Vermont 617 Main

[R] Error with glmulti

2014-03-06 Thread Alicia Ellis
), mydata, REML = F) print(lmer.model) proc.time() - ptm This works fine and gives the following output -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University of Vermont 617 Main Street Burlington, VT 05405 (802) 656-1046 http://www.wcs-heal.org http://www.uvm.edu/~aellis5

[R] Error with glmulti

2014-03-06 Thread Alicia Ellis
THE NEGATIVE LENGTH VECTORS ERROR IF WE INCLUDE HOUSEHOLD NESTED WITHIN THE OTHER RANDOM FACTORS FOR GLMULTI BUT NOT FOR LMER? ANY SUGGESTIONS FOR WHAT WE CAN DO TO DIAGNOSE OR FIX THE PROBLEM? Thanks! -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University of Vermont 617 Main

[R] help with NLOPTR

2013-01-03 Thread Alicia Ellis
require a local algorithm too opts=list(algorithm = NLOPT_GN_ISRES, xtol_rel = 0.01, maxeval=10 ,local_opts = local_opts, print_level=2) nloptr(x0=x0, eval_f = eval_f, lb=lb, ub=ub, eval_g_eq = eval_g_eq, opts=opts) -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University

[R] loading using Ryacas

2012-12-05 Thread Alicia Ellis
(yacas) and get this: Warning message: package ‘yacas’ is not available (for R version 2.15.2) Got the same thing for R version 2.15.1. Suggestions? I'm fairly new to R and could use some detailed instructions. Working on Mac OSx 10.8.2 Thanks! -- Alicia Ellis Postdoc Gund Institute for Ecological

[R] Solve system of equations (nleqslv) only returns origin

2012-12-04 Thread Alicia Ellis
]*(2*v1*N1*D)) - (delta2*theta*x[4]*(2*v2*N2*D)))-Cs*((2*v1*N1*D)+(2*v2*N2*D))) result=(x) } Xstart=c(1, 200, 0.5, 0.5, 12) fstart= firstordercond(Xstart) nleqslv(Xstart, firstordercond) -- Alicia Ellis Postdoc Gund Institute for Ecological Economics University of Vermont