knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)

Including Plots

You can also embed plots, for example:

plot(pressure)

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

#example data frams

library(tibble)

all_sim_data <- tibble

c1 <- c(2,-3,2,2,-3)
c2 <- c(2,0,-1,-1,0)
c3 <- c(0,0,+1,-1,0)
c4 <- c(0,+1,0,0,-1)
rbinom(1,20,.05)

?rbinom
A <- replicate(10000, sum(rbinom(20, 1, .05)))
hist(A)

length(A[A> 0])/10000
A <- replicate(10000, sum(rbinom(20, 1, .05)))
hist(A)

length(A[A> 0])/10000

A<-rbinom(10000, 20, .05)

A <-rbinom(10000, 50, .05)

#length(A[A > 0])/10000))
t_results  <- replicate(1000, t.test(rnorm(10, 0, 1), rnorm(10, 0, 1), var.equal= TRUE)$p.value)

hist(t_results)


celiaflorea/statslab2022 documentation built on Aug. 31, 2022, 5:29 p.m.