University of California, Los Angeles STATS 13 Lab 1. Fall 20221. heights <- c(73,65,75)> heights[1] 73 65 752. names <- c("savannah", "catherine", "vanessa")> # Type your CODE in here> names[1] "savannah" "catherine" "vanessa"3. > cbind(heights, names)heights names[1,] "73" "savannah"[2,] "65" "catherine"[3,] "75" "vanessa">The command took the vectors that we input and combined them into the col
...[Show More]
1. heights <- c(73,65,75)
> heights
[1] 73 65 75
2. names <- c("savannah", "catherine", "vanessa")
> # Type your CODE in here
> names
[1] "savannah" "catherine" "vanessa"
3. > cbind(heights, names)
heights names
[1,] "73" "savannah"
[2,] "65" "catherine"
[3,] "75" "vanessa"
>The command took the vectors that we input and combined them into the columns of a
matrix
4. NCbirths <- read.csv("births.csv")
5.
6. > weights <- NCbirths$weight
> weights
[1] 124 177 107 144 117 98 147 138 104 123 153 129 119 108 106 125 115 128 132 83 117
[22] 130 130 103 85 133 122 134 84 117 118 164 147 106 144 117 95 112 115 107 135 105
[43] 119 143 112 177 119 136 119 33 118 134 106 118 106 130 112 102 134 116 134 117 61
[64] 132 119 129 57 130 104 118 123 135 124 118 77 128 94 122 108 116 117 115 112 89
Stats 13
Lab 1
7. > weights_in_pounds <- weights/16
> weights_in_pounds[1:20]
[1] 7.7500 11.0625 6.6875 9.0000 7.3125 6.1250 9.1875 8.6250 6.5000 7.6875 9.5625
[12] 8.0625 7.4375 6.7500 6.6250 7.8125 7.1875 8.0000 8.2500 5.1875
8. > mean(weights_in_pounds)
[1] 7.253691
9. > tally(NCbirths$Habit, format = "percent")
X NonSmoker Smoker
0.3003003 90.3403403 9.3593594
[Show Less]