Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timedist should be able to fit multiple models #10

Open
nathaneastwood opened this issue Aug 17, 2016 · 2 comments
Open

timedist should be able to fit multiple models #10

nathaneastwood opened this issue Aug 17, 2016 · 2 comments

Comments

@nathaneastwood
Copy link
Owner

Currently you have to fit single models one at a time.

@nathaneastwood
Copy link
Owner Author

This is probably achievable with purrr

@nathaneastwood
Copy link
Owner Author

Actually, a much nicer way (and cleaner dependency way) would be to switch to data.table as the backend.

> dt <- data.table('x'=rnorm(100),'y'=rnorm(100),'g'=sample(c('a','b'),100,replace=T),key='g')
> GLMs <- dt[,list(glms=list(glm(formula=y~x))), by='g']
> GLMs[g == "a", glms][[1]]

Call:  glm(formula = y ~ x)

Coefficients:
(Intercept)            x  
    0.02669      0.16465  

Degrees of Freedom: 46 Total (i.e. Null);  45 Residual
Null Deviance:	    49.08 
Residual Deviance: 48.1 	AIC: 140.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant