Improve printing
This commit is contained in:
12
A1.Rmd
12
A1.Rmd
@@ -30,9 +30,9 @@ Because t is greater than the critical t, 3.910959 \> 2.093024, we can reject th
|
|||||||
## b)
|
## b)
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20)) # Interval from mean
|
(interval <- qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20))) # Interval from mean
|
||||||
mean(data) - qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20))
|
mean(data) - interval
|
||||||
mean(data) + qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20))
|
mean(data) + interval
|
||||||
```
|
```
|
||||||
|
|
||||||
The confidence interval with 95% confidence is [15.37186, 16.22814]
|
The confidence interval with 95% confidence is [15.37186, 16.22814]
|
||||||
@@ -59,9 +59,9 @@ Because t is greater than critical t, 10.28571 \> 3.249836, we can reject the nu
|
|||||||
## b)
|
## b)
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10)) # Interval from mean
|
(interval <- qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10))) # Interval from mean
|
||||||
mean(diff) - qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10))
|
mean(diff) - interval
|
||||||
mean(diff) + qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10))
|
mean(diff) + interval
|
||||||
```
|
```
|
||||||
|
|
||||||
The confidence interval with 99% confidence is [3.28341, 6.31659]
|
The confidence interval with 99% confidence is [3.28341, 6.31659]
|
||||||
|
Reference in New Issue
Block a user