How to apply the drm function to subsets of a dataframe in R?

178 Views Asked by At

I want to do dose-response modelling with a large dataset. Is there an option to use e.g. the lapply or map function to apply the drm function to the individual subsets of the data? Or has this problem possibly to be solved by a loop?

I successfully structured my data by the split function and got a list of 73 dataframes. In the next step I want to do the dose-response modelling individually for all subsets but without naming every subset individually. The lapply function returns the error that the object 'response' could not be found. Any ideas how I can solve my problem without an endless code? I am an absolut beginner in R and apologize if this is a stupid question. Thanks in advance for every comment!

data_split <- split(data, f = list(data$sample, data$date), drop = TRUE) lapply(data_split, drm(data=data_split, response ~ dose,fct=LL.5())

0

There are 0 best solutions below