[R] How to analyse nonlinear response to categorical and quantitative explanatory variables?

Michael Friendly friendly at yorku.ca
Fri Feb 20 14:27:05 CET 2015


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
>
>
>



More information about the R-help mailing list