Question

This is 3 short questions that needs to be answered in R programming:

You are given a data set titled data.txt and the following code:

data <- read.table("data.txt", header = TRUE)

The dataset looks like this:

id Sex Genotype Activity 1 male ff 2 male ff 3 male fs 4 female ff 5 male fs 6 female ff 7 female ss 1.884 2.283 2.396 2.838

Question:

1. Create a table containing the sample size for each combination of sex and genotype (code in R).

2. Calculate the mean and standard deviation for each combination of sex and genotype (code in R).

3. Create side by side boxplots of MPI activity for the three types of **Genotype** (code in R)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Suppose your dataset is 'df'

# then for for accesing the sex and genotype use

names(df) <- c("Genotype", "Sex")

# Mean is -:

mean( df [ ["Genotype", "Sex"] ] )

# Standard deviation  is -:

sd( df [ ["Genotype", "Sex"] ] )

Add a comment
Know the answer?
Add Answer to:
This is 3 short questions that needs to be answered in R programming: You are given a data set ti...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT