fin4ans.docx - str(data'data.frame $ id 7 8 9 10 $ Species...

This preview shows page 1 - 3 out of 3 pages.

str (data) ## 'data.frame': 300 obs. of 6 variables: ## $ id : Factor w/ 300 levels "S001","S002",..: 1 2 3 4 5 6 7 8 9 10 ... ## $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ... ## $ Sepal.Length: num 4.75 5.07 5.24 5.48 4.9 ... ## $ Sepal.Width : num 3.3 3.68 3.44 3.96 2.81 ... ## $ Petal.Length: num 1.44 1.21 1.59 1.53 1.49 ... ## $ Petal.Width : num 0.235 0.111 0.405 0.272 0.345 ... summary (data) ## id Species Sepal.Length Sepal.Width Petal.Length ## S001 : 1 setosa :100 Min. :4.417 Min. :1.796 Min. :1.135 ## S002 : 1 versicolor:100 1st Qu.:5.209 1st Qu.:2.720 1st Qu.:1.566 ## S003 : 1 virginica :100 Median :5.844 Median :2.992 Median :4.228 ## S004 : 1 Mean :5.857 Mean :3.064 Mean :3.738 ## S005 : 1 3rd Qu.:6.448 3rd Qu.:3.375 3rd Qu.:5.205 ## S006 : 1 Max. :8.478 Max. :4.810 Max. :6.955 ## (Other):294 ## Petal.Width ## Min. :-0.03371 ## 1st Qu.: 0.30278 ## Median : 1.28776 ## Mean : 1.19830 ## 3rd Qu.: 1.87452 ## Max. : 2.62487 ## setosa = data[data $ Species == "setosa" , ] versicolor = data[data $ Species == "versicolor" , ] setosa.v.versicolor <- t.test ( x = setosa $ Sepal.Length, y = versicolor $ Sepal.Length, var.equal = TRUE , paired = FALSE ) setosa.v.versicolor ## ## Two Sample t-test ## ## data: setosa$Sepal.Length and versicolor$Sepal.Length ## t = -14.045, df = 198, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture