Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread William Dunlap via R-help
> copies from your system and destroy any hard copies. You must > > not, directly or indirectly, use, disclose, distribute, > > print or copy any part of this message or any attachments if you are not > > the intended recipient. > > *From:* William Dunlap [mailto:wdun...@tib

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread Bos, Roger
this message or any attachments if you are not the intended recipient. From: William Dunlap [mailto:wdun...@tibco.com] Sent: Friday, October 07, 2016 11:57 AM To: Bos, Roger Cc: R-help Subject: Re: [R] weighted regression inside FOREACH loop Using the temporary child environment works because

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread William Dunlap via R-help
t;> attr(datdf, "weights") <- rep(c(1,2), 50) >> mod <- lm(fmla, data=datdf, weights=attr(data, "weights")) >> return(mod$coef) >> } >> Models >> >> >> >> >> >> -Original Message- >> From:

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread William Dunlap via R-help
> attr(datdf, "weights") <- rep(c(1,2), 50) > mod <- lm(fmla, data=datdf, weights=attr(data, "weights")) > return(mod$coef) > } > Models > > > > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bos

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread Bos, Roger
riginal Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bos, Roger Sent: Friday, October 07, 2016 9:25 AM To: R-help Subject: [R] weighted regression inside FOREACH loop I have a foreach loop that runs regressions in parallel and works fine, but when I try to add the w

Re: [R] weighted regression inside FOREACH loop

2016-10-07 Thread Thierry Onkelinx
Dear Roger, Maybe you want to return(mod) instead of return(mod$coef) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgiu

[R] weighted regression inside FOREACH loop

2016-10-07 Thread Bos, Roger
I have a foreach loop that runs regressions in parallel and works fine, but when I try to add the weights parameter to the regression the coefficients don’t get stored in the “models” variable like they are supposed to. Below is my reproducible example: library(doParallel) cl <- makeCluster(4)

Re: [R] Weighted regression markers on scatter plots

2013-10-17 Thread Jim Lemon
On 10/17/2013 04:04 AM, Msugarman wrote: Hi all, I'm trying to graph the results of a weighted regression analysis. Is anyone aware of a way to make my markers appear a different sizes to be consistent with their respective weights? Hi Mike, Have a look at the "size_n_color" function in the pl

Re: [R] Weighted regression markers on scatter plots

2013-10-17 Thread David Winsemius
On Oct 16, 2013, at 10:04 AM, Msugarman wrote: > Hi all, > > I'm trying to graph the results of a weighted regression analysis. Is anyone > aware of a way to make my markers appear a different sizes to be consistent > with their respective weights? You have not produced any data or code. If usi

Re: [R] Weighted regression markers on scatter plots

2013-10-17 Thread Greg Snow
The simplest approach is to specify the cex parameter in the call to plot. plot(1:3, 1:3, cex=3:1) for example will plot the 1st point 3 times as big, the 2nd 2 times as big, and the 3rd at the standard size. You can get more control by using the symbols function instead of the plot function and

[R] Weighted regression markers on scatter plots

2013-10-17 Thread Msugarman
Hi all, I'm trying to graph the results of a weighted regression analysis. Is anyone aware of a way to make my markers appear a different sizes to be consistent with their respective weights? Thanks, -Mike Sugarman Wayne State University -- View this message in context: http://r.789695.n4.nab

[R] weighted(?) regression

2013-06-11 Thread M M
folks, any suggestions on how to estimate the following regression? i'm not even sure if this kind of regression has a name? y(t) = phi * y(t-1) + (1 - phi) * x(t) + e(t) i need to determine phi, which has to be in (0, 1) i don't know how to fit this into the lm() formulation. thanks, murali

Re: [R] Weighted regression in rms/Hmisc

2013-05-19 Thread Frank Harrell
You should be able to pass a weights argument through fit.mult.impute to ols. I assume that weights are with respect to variables that you, for some reason, do not want to have as predictors. Otherwise you are already conditioning on the weighting factors and no weights are needed. Frank Mullah

[R] Weighted regression in rms/Hmisc

2013-05-19 Thread Mullah Abu Shadeque
Hi all,  While using  the following package and code:    library(rms) library(Hmisc) test.trans<-aregImpute( ~ NearestWeekGestation + MaternalBMI + MomAge_Years +      WtGain + ethnicity , n.impute=10 ,data=data.1)    test.mod<-fit.mult.impute(BirthWeight_g ~ rcs(NearestWeekGes

[R] weighted regression using drm() in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

[R] weighted regression in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

[R] Weighted Regression

2008-08-29 Thread Williams, Robin
Hello, Firstly let me explain that the nature of what I want to do is actually beyond my statistical knowledge, having only taken a second year university stats course last year. Therefore I may have missed the statistical essence of what I want to do as well as my lack of ability to do it in R.