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

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.

• Sample size? i.e., how many subjects were used in your study? – user158565 Oct 19 '18 at 22:38
• There are 40 subjects for each Treatment x Genotype combination (880 subjects total) – user3574652 Oct 20 '18 at 2:02

## 1 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)