vendredi 11 septembre 2015

How to compute for the mean and sd

I need help on 4b please

  1. ‘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.

    b. For the ‘AM.warpbreaks’ dataset, compute for the mean and the standard deviation of the breaks variable for those observations with breaks value not exceeding 30.

    data(warpbreaks)
    warpbreaks <- data.frame(warpbreaks)
    AM.warpbreaks <- subset(warpbreaks, wool=="A" & tension=="M")
    
    mean(AM.warpbreaks<=30)
    sd(AM.warpbreaks<=30)
    
    

This is what I understood this problem and typed the code as in the last two lines. However, I wasn't able to run the last two lines while the first 3 lines ran successfully. Can anybody tell me what is the error here? Thanks! :)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire