Improve printing

This commit is contained in:
2025-09-18 13:45:19 -03:00
parent f55562e41f
commit c8acd0c434

12
A1.Rmd
View File

@@ -30,9 +30,9 @@ Because t is greater than the critical t, 3.910959 \> 2.093024, we can reject th
## b)
```{r}
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) + qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20))
(interval <- qt(1 - (0.05/2), 20-1) * (sd(data)/sqrt(20))) # Interval from mean
mean(data) - interval
mean(data) + interval
```
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)
```{r}
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) + qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10))
(interval <- qt(1 - (0.01/2), 10-1) * (sd(diff)/sqrt(10))) # Interval from mean
mean(diff) - interval
mean(diff) + interval
```
The confidence interval with 99% confidence is [3.28341, 6.31659]