Displaying 1 result from an estimated 1 matches for "tab200".
Did you mean:
tab201
2019 Mar 03
2
bug: sample( x, size, replace = TRUE, prob= skewed.probs) produces uniform sample
....seed(123)
>
> epsilon <- 1e-10
>
> ## uniform to 200 then small
> p200 <- prop.table( rep( c(1, epsilon), c(200, 999-200)))
> ## uniform to 201 then small
> p201 <- prop.table( rep( c(1, epsilon), c(201, 999-201)))
>
> brks <- c(0,99,199,200,201,Inf)
> tab200 <- sample( length(p200), 10000, prob=p200, replace=TRUE)
> tab201 <- sample( length(p201), 10000, prob=p201, replace=TRUE)
>
> cbind(
+ s200=table(cut(tab200, brks)),
+ p200=round(xtabs(p200 ~ cut( seq_along(p200), brks)) * 10000 ,1),
+ s201=table(cut(tab201, brks )),
+ p201...