project.org] On Behalf Of Gary Dong
> Sent: Tuesday, November 26, 2013 12:36 AM
> To: r-help@r-project.org
> Subject: [R] summary many regressions
>
> Dear R users,
>
> I have a large data set which includes data from 300 cities. I want to
> run a biviriate regression for e
Hi,
Try:
res <- do.call(rbind,lapply(split(data,data$city),function(z) {fit_city <-
lm(y~x,data=z);data.frame(City=unique(z$city),Coefficient=coef(fit_city)[2],Adjusted_R_square=
summary(fit_city)$adj.r.squared)}))
A.K.
On Monday, November 25, 2013 6:37 PM, Gary Dong wrote:
Dear R users,
I
On Nov 25, 2013, at 3:35 PM, Gary Dong wrote:
> Dear R users,
>
> I have a large data set which includes data from 300 cities. I want to run
> a biviriate regression for each city and record the coefficient and the
> adjusted R square.
>
> For example, in the following, I have 10 cities represe
Dear R users,
I have a large data set which includes data from 300 cities. I want to run
a biviriate regression for each city and record the coefficient and the
adjusted R square.
For example, in the following, I have 10 cities represented by numbers from
1 to 10:
x = cumsum(c(0, runif(999, -1,
4 matches
Mail list logo