Jan-Ulrich Kreft
2015-Feb-19 14:47 UTC
[R] How to analyse nonlinear response to categorical and quantitative explanatory variables?
Dear list I have data from a collaborator who has used DesignExpert to design the experiment and analyse the data but no longer has access to this software and does not know exactly what the software did and why. So I?m now trying to analyse the data in R but can't quite decide what to do. Cell count is the response variable (number of cells attached to a surface per unit area and time interval, so could be Poisson distributed). This cell count depends on whether the surface was oriented upwards or downwards (categorical - with or against gravity). Some more categorical variables were also studied such as surface material (glass or polycarbonate, symbols g and p in the figure) and position in flow cell (inlet or outlet), but they seem to have no significant effect. Cell count also depends on a quantitative variable in a nonlinear manner: the flow rate with which the cell suspension was pumped along the surface. I was wondering which kind of statistical model would be appropriate. I was first thinking ANCOVA but this seems to be a linear model and treating the quantitative explanatory variable as covariate when this is actually of interest. What else could I use? Attached a figure showing the means of 4 replicates. Many thanks. Best wishes, Jan. --- Dr Jan-Ulrich Kreft +44 (0)121 41-48851 School of Biosciences University of Birmingham, Birmingham, B15 2TT, UK http://www.tinyurl.com/kreftlab -------------- next part -------------- A non-text attachment was scrubbed... Name: Cells_vs_rpm_means2.pdf Type: application/pdf Size: 6730 bytes Desc: Cells_vs_rpm_means2.pdf URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150219/79b2834f/attachment.pdf>
Michael Friendly
2015-Feb-20 13:27 UTC
[R] How to analyse nonlinear response to categorical and quantitative explanatory variables?
You want to use a generalized linear model of some sort glm(count ~ flow + gravity + group, data=mydata, family=poisson) would be a start, however, the effects of flow rate are nonlinear, so you might use a natural spline term like ns(flow,5) to allow nonlinearity, and there also seem to be interactions in your plot. library(splines) glm(count ~ ns(flow,5) * gravity + group, data=mydata, family=poisson) That might get you started while you look for a statistician to consult with. -Michael On 2/19/2015 9:47 AM, Jan-Ulrich Kreft wrote:> Dear list > > I have data from a collaborator who has used DesignExpert to design the experiment and analyse the data but no longer has access to this software and does not know exactly what the software did and why. > > So I?m now trying to analyse the data in R but can't quite decide what to do. > > Cell count is the response variable (number of cells attached to a surface per unit area and time interval, so could be Poisson distributed). > > This cell count depends on whether the surface was oriented upwards or downwards (categorical - with or against gravity). Some more categorical variables were also studied such as surface material (glass or polycarbonate, symbols g and p in the figure) and position in flow cell (inlet or outlet), but they seem to have no significant effect. > > Cell count also depends on a quantitative variable in a nonlinear manner: the flow rate with which the cell suspension was pumped along the surface. > > I was wondering which kind of statistical model would be appropriate. I was first thinking ANCOVA but this seems to be a linear model and treating the quantitative explanatory variable as covariate when this is actually of interest. What else could I use? > > Attached a figure showing the means of 4 replicates. > > Many thanks. > > Best wishes, > Jan. > > --- > Dr Jan-Ulrich Kreft > +44 (0)121 41-48851 > School of Biosciences > University of Birmingham, Birmingham, B15 2TT, UK > http://www.tinyurl.com/kreftlab > > >