Mostrar el supuesto de eficiencia, insesgadez (cambiar la semilla ) y consistencia (cambiar el tamaño de muestra) empíricamente (simulación) con 1000 interacciones.
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
set.seed(1)
x=rnorm(20000, 1030000, 200000)
hist(x)
beta1=rnorm(20000,0.3,0.02)
hist(beta1)
beta=runif(20000, 150000,200000)
summary(beta)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 150006 162308 174739 174873 187509 199990
plot(density(beta1), col="Red")
Y=beta+beta1*x
####data.frame
df=data.frame(x,Y)
plot(x,Y)
df=data.frame(Y,x, beta1,beta)
datos=data.frame(Y,x)
head(datos)
## Y x
## 1 446293.5 904709.2
## 2 490389.3 1066728.7
## 3 429654.9 862874.3
## 4 537658.7 1349056.2
## 5 529726.5 1095901.6
## 6 444605.8 865906.3
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.