‘Warpbreaks’ is a built-in dataset in R. Load it using the function data(warpbreaks)
. It consists of the number of warp breaks per loom, where a loom corresponds to a fixed length of yarn. It has three variables namely, breaks, wool, and tension.
a.) Write a code (Hint: a logical expression) that extracts the observations with wool type A and tension level M. Assign it to the object AM.warpbreaks
.
b.) For the AM.warpbreaks
data set, compute for the mean and the standard deviation of the breaks variable for those observations with breaks
value not exceeding 30.
My code for 4a) (However, it didn't work. Can somebody help me how to solve this problem?)
warpbreak <- data(warpbreaks("breaks", "wool", "tension")) AM.warpbreaks <- c('','type A','level M')
Contents
hide
Best Answer
Here you go:
data(warpbreaks) warpbreaks <- data.frame(warpbreaks) AM.warpbreaks <- subset(warpbreaks, wool=="A" & tension=="M")
Similar Posts:
- Solved – Can we use the “predict” function for a gee model?
- Solved – Interpreting the standard error from emmeans – R
- Solved – Poisson regression for count data – predictions
- Solved – Data matrix, predictor matrix, observation matrix, model matrix, and design matrix. What do they mean
- Solved – One-way ANOVA, clustering levels using Tukey Kramer HSD