Solved – Analysis of two categorical independent variables with one categorical (ordinal) and one continuous dependent variables

categorical datacontingency tablesordinal-datar

I am trying to understand how best to analyze my data, or find similar examples.

I have two independent variables: Treatment (11 categorical levels) and Genotype (2 categorical levels). I then measure Developmental level (5 ordinal categorical levels) and Weight (continuous). One of the Developmental levels is "did not survive" and thus has no Weight (at end of experiment) associated with it.

I want to test if Treatment and Genotype, and their interaction, have an effect on Development and Weight.

The closest I have come to a related example is the "Stem Cell Research and Religious Fundamentalism" example in http://users.stat.ufl.edu/~aa/ordinal/R_examples.pdf that was mentioned by @G-Grothendieckin in Regression with all explanatory variables being categorical (not ordinal) and dependent variable being ordinal

However, this example specifically mentions turning one of the categorical independent variables into a quantitative variable.

Best Answer

In general, it is the nature of the dependent variable which drives what type of statistical analysis you have to use (as well as the design of your study, your research questions and any special features of the data and possibly sample size).

In your case, you seem to have one ordinal dependent variable and one continuous dependent variable. The ordinal dependent variable will warrant the use of an ordinal logistic regression model. The continuous dependent variable may require the use of a linear regression model.

Was every subject in your study measured just once? If yes, the statements below apply.

For the ordinal logistic regression model, see ftp://ftp.stat.math.ethz.ch/R-CRAN/web/packages/ordinal/vignettes/clm_tutorial.pdf for an example. As you will see in the example, all you have to do to specify your model is something like this:

require(ordinal)
m <- clm(Development ~ Treatment + Genotype + Treatment:Genotype, data = YourData)

It seems like you should keep the category "Did Not Survive" in your model if you had study subjects for which this category applied.

For the Weight outcome, you could consider only the subjects who did not survive and analyze their weights with a linear model:

 m <- lm(Weight ~ Treatment + Genotype + Treatment:Genotype, data = YourDataSubset)
Related Question