Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
Running Code
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.4.3
Warning: package 'tidyr' was built under R version 4.4.3
Warning: package 'readr' was built under R version 4.4.3
Warning: package 'purrr' was built under R version 4.4.3
Warning: package 'dplyr' was built under R version 4.4.3
Warning: package 'stringr' was built under R version 4.4.3
Warning: package 'forcats' was built under R version 4.4.3
Warning: package 'lubridate' was built under R version 4.4.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(purrrfect)
Attaching package: 'purrrfect'
The following objects are masked from 'package:base':
replicate, tabulate
ggplot(data = dice_means)+geom_histogram(aes(x = y_sample, y =after_stat(density)),fill ="goldenrod",center =0.1, binwidth =0.05)+geom_line(stat ="function",aes(y =after_stat(dnorm(x, mean =3.5, sd =sqrt(35/ (12* n))))),color ="cornflowerblue",linewidth =1)+facet_grid(n ~ ., labeller = label_both)+theme_classic(base_size =16)+labs(title =" Y bar and n",x =expression(bar(Y)),y ="Density" )
Warning: Computation failed in `stat_bin()`.
Caused by error in `scales[[x]]$dimension()`:
! attempt to apply non-function
Warning: Computation failed in `stat_bin()`.
Computation failed in `stat_bin()`.
Computation failed in `stat_bin()`.
Caused by error in `scales[[x]]$dimension()`:
! attempt to apply non-function
Warning: Computation failed in `stat_function()`.
Computation failed in `stat_function()`.
Computation failed in `stat_function()`.
Computation failed in `stat_function()`.
Caused by error in `compute_group()`:
! argument "fun" is missing, with no default
# Each y hat and n have different centers and variabilty based on the differnt points from the n and y hat vaules. dice_means %>%group_by(n) %>%summarise(E_Ybar_hat =mean(f_ybar),Var_Ybar_hat =var(f_ybar),E_Ybar_theory =3.5,Var_Ybar_theory =35/ (12*first(n)) )
ggplot(data = sum_of_POI)+geom_histogram(aes(x = u, y =after_stat(density)),fill ='goldenrod',center =0.1, binwidh = .2)+geom_line(aes(x = u, y = f_U), col='cornflowerblue')+facet_grid(n~lambda, labeller = label_both)+theme_classic(base_size =16)+labs(title='Simulated and analytic densities for sum of Poision')
Warning in geom_histogram(aes(x = u, y = after_stat(density)), fill =
"goldenrod", : Ignoring unknown parameters: `binwidh`
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.