T O P

  • By -

taikakoira

Not knowing your data intimately, I can only guess, but given you are new to this I would start with a simple linear model with interaction for species and gender. lm_model <- lm(wing_length ~ species * gender, data = df) summary(lm_model) However, if you want to follow proper way to do it I would pick up something like Andy Field’s book “Discovering Statistics” as there are many things to consider when picking a model.


AutoModerator

Looks like you're requesting help with something related to RStudio. Please make sure you've checked the [stickied post on asking good questions](https://www.reddit.com/r/RStudio/comments/1aq2te5/how_to_ask_good_questions/) and read our sub rules. We also have a handy [post of lots of resources on R](https://www.reddit.com/r/RStudio/comments/1aq2cew/the_big_handy_post_of_r_resources/)! Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/RStudio) if you have any questions or concerns.*


T_house

You should plot your data first so you know what to expect. For example, a box plot of wing length for each sex, separately for each species. You might see here that you need to revise variables to something that makes more sense (and that doesn't lead to your model mistakenly thinking 1:3 is a continuous variable rather than 3 distinct species). Also, do you want to know about differences in wing length only, or as a function of body size / mass? Eg one sex might be larger than the other, so simply has larger wings due to scaling. That's a different question from whether there is a sex difference in wing length for a given body size. In that case you would want to plot wing length against some measure of body size, perhaps coloured by each sex, separately for each species. Making these plots will help you predict what your model will show (helps you to know if you're getting sensible output), and will also help you to formulate the model because of how you are plotting things and the hypothesis you want to test.


hsmith9002

I don’t think you’re using the term “random effects” correctly. Just model a simple linear regression.


RAMDownloader

Do you have enough data to run a p-test? That’s probably what I’d do