[R] Testing a non-binary categorical variable with coxph and robust variance

2015-12-09 Thread Brant Inman
__ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible c

Re: [R] Passing variable names in quotes to a function

2015-12-02 Thread Brant Inman
ta <- data[subset, ] > fit <- some_regression_tool(formula, data = data) > > ## > > data_after_processing > } > > with subset = subY == subY.val. > > Best, > > Philippe > >> On 02 Dec 2015, at 06:11, Brant Inman wrote: >> >>

[R] Passing variable names in quotes to a function

2015-12-01 Thread Brant Inman
I am trying to build a function that can accept variables for a regression. It would work something like this: --- # Y = my response variable (e.g. income) # X = my key predictor variable (e.g. education) # subY = a subsetting variable for Y (e.g. race) # subY.val = the value of the subsetting v

[R] Programming R to avoid loops

2015-04-17 Thread Brant Inman
a faster matching algorithm. I am pretty certain that R functions can be used to do this but I do not have a good grasp of how to make it work. Brant Inman [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To U

Re: [R] geeglm error NA/NaN/Inf in 'y'

2014-03-02 Thread Brant Inman
were trying to help me). This error is not reversible by converting y.fac back into a numeric variable. Interestingly, the ordgee function from the same geepack package handles the factor response variable without issue and appears to give results that best mimic the textbook example. Thanks to

Re: [R] geeglm error NA/NaN/Inf in 'y'

2014-03-01 Thread Brant Inman
want to check out the repolr and multgee packages as well > > Duncan > > Duncan Mackay > Department of Agronomy and Soil Science > University of New England > Armidale NSW 2351 > Email: home: mac...@northnet.com.au > > > > -Original Message- > From: r-help-boun...

[R] geeglm error NA/NaN/Inf in 'y'

2014-03-01 Thread Brant Inman
R-helpers: I am getting an error when trying to fit a GEE model. Below is code reproducing the error. ### library(foreign) muscatine <- read.dta('http://www.hsph.harvard.edu/fitzmaur/ala2e/muscatine.dta') muscatine$gender <- as.factor(muscatine$gender) muscatine$y <- as.factor(muscati

Re: [R] Measuring correlations in repeated measures data

2011-02-28 Thread Brant Inman
and 14. Is there a function in nlme or lme4 that does this? Brant On Feb 28, 2011, at 02:24 AM, Ben Bolker wrote: Brant Inman mac.com> writes: > > R-helpers: > > I would like to measure the correlation coefficient between the repeated measures of a single variable > that i

[R] Measuring correlations in repeated measures data

2011-02-27 Thread Brant Inman
R-helpers: I would like to measure the correlation coefficient between the repeated measures of a single variable that is measured over time and is unbalanced. As an example, consider the Orthodont dataset from package nlme, where the model is: fit <- lmer(distance ~ age + (1 | Subject), dat

[R] Replacing rows in a data frame

2011-01-17 Thread Brant Inman
R-helpers, Below is a simple example of some output that I am getting while trying to work with a data frame in R 2.12.1 for Mac. - > testdat <- data.frame(matrix(ncol=10, nrow=10)) > colnames(testdat) <- c('a','b','c','d','e','f','g','h','i','j') > testdat[seq(1,10,3),] <- c(1,0,0,0,0,0,0,0

[R] predict.drm not generating confidence intervals

2010-11-28 Thread Brant Inman
NANA [6,] 7.788784NANA There appears to be a problem with the predict.drc function. This code previous generated confidence and prediction intervals in columns 2 and 3 of the prediction matrices but now fails for reasons unknown to me. Anyone have an idea of what

[R] Error: package 'pcvsuite' was built before R 2.10.0: please re-install it

2010-11-16 Thread Brant Inman
rror: package 'pcvsuite' was built before R 2.10.0: please re-install it > Anybody have an idea of how I can use the pcvsuite package running on R 2.12.0 for Mac? Thank you in advance for any solutions. Brant Inman Duke University [[altern

[R] Prediction and confidence intervals from predict.drc

2010-09-06 Thread Brant Inman
R-helpers, I am using the package "drc" to fit a 4 parameter logistic model. When I use the predict function to get prediction on a new dataset, I am not getting the requested confidence or prediction intervals. Any idea what is going on? Here is code to reproduce the problem: --- library(

Re: [R] [R-sig-ME] Duplicating meta-regression results from PROC MIXED with lmer

2009-05-06 Thread Brant Inman
rstand why. Brant On May 5, 2009, at 11:43 PM, Rolf Turner wrote: On 6/05/2009, at 3:00 PM, Brant Inman wrote: R-experts: In 2002, Hans Van Houwelingen et al. published a tutorial on how to do meta-regression in Statistics in Medicine. They used the classic BCG dataset of Colditz to d

[R] Duplicating meta-regression results from PROC MIXED with lmer

2009-05-05 Thread Brant Inman
pointed out my error with models f3 and f4 and why they do not seem to be correct. Incidentally, other sources (ex: Egger/Altman book on systematic reviews) report results on this dataset similar to Van Houwelingen, so I think that my code is definitely the problem. Thanks, Brant Inm

Re: [R] [R-SIG-Mac] Error with update.packages()

2008-09-04 Thread Brant Inman
ant - On Sep 4, 2008, at 2:59 PM, Prof Brian Ripley wrote: Try another mirror: this is not the first time we've seen problems at www.ibiblio.org. On Thu, 4 Sep 2008, Brant Inman wrote: R-helpers: I just updated from R 7.0 to R 7.2.2 today. I am using MAC OS X version

[R] Error with update.packages()

2008-09-04 Thread Brant Inman
t(fmt, domain = domain), ...) : argument is missing, with no default The first part of the procedure seemed to work, then came page after page of error messages. Can someone tell me what is going on here and how I can fix the problem? I found a similar report

[R] Likelihood ratio test for competing risks regression

2008-02-03 Thread Brant Inman
as a predictor in the fake model in fit1 (stage being represented by the 3 dummy variables stage2, stage3 and stage4), would the LR test calculated in the last line of code be valid? Given the pseudolikelihood used in the crr fit, I am not sure if this is a valid statistical test. Thanks for any c

[R] Converting a character string into an object variable

2008-01-31 Thread Brant Inman
quot;, i, sep="") <- input.value[i] } Of course this loop will not work since the paste function returns a character string that cannot be a variable. How can I construct a loop to create sequential variables and assign a value to them in the same spirit of the loop above? Brant Inman Mayo Cli

Re: [R] 'matrix' returns integer instead of decimal

2008-01-20 Thread Brant Inman
*As usual, the R-helpers were bang on. Some package must have modified my digits option without me noticing.* ** *--* ** *> test <- matrix(c(7,47,4,38,20,96,1,14,10,48,2,101,12,161, + 1,28,1,19,22,49,25,162,31,200,9,39,22,193, + 0.5,45.5,31,131,4,75,31,220,7,55,3,91,14.5, + 25.5,3,

[R] 'matrix' returns integer instead of decimal

2008-01-20 Thread Brant Inman
he problems in rows 15, 21, 37 and 43. They should read [0.5, 45.5], [14.5, 21.5], etc... The matrix function seems to be rounding the second column up to the next integer. Why would this occur? Can I do something to prevent this? I would very much appreciate any comments. Thanks, Bran