Hi,
I would like to split my mycars dataset into three subsets based on the cyl variable and apply linear regression on each of these datasets. Is there any way I can do this? Similar R code to achieve this is:
models1 = lapply(split(mtcars, mtcars$cyl), \(x)lm(mpg ~ disp, data = x))
tidy_list = lapply(models1, tidy)
tidy_list
Split and Apply
Re: Split and Apply
there's not a neat way to do this at this time unfortunately ... but you can do something like:
Re: Split and Apply
I know this method, but I would like to see the combined data in one place. lme4 or nlme got a neat function lmList which achieves exactly this. In future, I would like jamovi should have this capacity to split the data and apply t-test, anova, lm etc and get combined results. I have seen this capability in bluesky statistics.
Re: Split and Apply
yup ... we've got plans for this.
jonathon
jonathon