> 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
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
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:
> 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
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
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
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)
7 matches
Mail list logo