You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't yet have the commands to generate random samples. I suggest they go in the probability keyboard they are a new section called Random.
a) the existing probability keys are 5 across. So I suggest we continue with that layout.
b) The first row might be uniform, normal, uni_integer, bernoulli, binomial
c) the second row could then be poisson, nbinomial, gamma, beta, sample
d) Uniform is runif(n) - where the n is the usual n=nrow(x=survey), etc, because we must have a sample of size the same as the length of the particular data frame. The tooltip Random sample from the uniform distribution between 0 & 1. Use say runif(n,5,10) to change the range.
(Use examples from the Integer keyboard to understand the code needed to produce the "n" above and in other examples.)
e) normal is rnorm(n) with tooltip Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd.
f) uni-integer is sample.int(5, n,replace=TRUE) with tooltip Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.
g) bernoulli is rbinom(n,1,prob=0.5) with tooltip Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.
h) binomial is rbinom(n,3,prob=0.5) with tooltip Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions.
i) poisson is rpois(n,lamda=1) with tooltip: Random Poisson sample with mean 1. Change the mean as required.
j) negative binomial is rnbinom(n,size=1,prob=0.5) tooltip Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.
k) gamma is rgamma(n,shape=1,scale=2) tooltip Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square. l) beta is rbeta(n,shape1=1,shape2=1) With tooltip "This special case is the uniform distribution between 0 and 1. Change shape1 > 0 and shape2 > 0 for different beta distributions. m) sample is sample( ,n,replace=TRUE) Random sample with replacement, from a given variable. Change replace to FALSE for a random permutation.
The text was updated successfully, but these errors were encountered:
We don't yet have the commands to generate random samples. I suggest they go in the probability keyboard they are a new section called
Random
.a) the existing probability keys are 5 across. So I suggest we continue with that layout.
b) The first row might be
uniform, normal, uni_integer, bernoulli, binomial
c) the second row could then be
poisson, nbinomial, gamma, beta, sample
d) Uniform is runif(n) - where the n is the usual n=nrow(x=survey), etc, because we must have a sample of size the same as the length of the particular data frame. The tooltip
Random sample from the uniform distribution between 0 & 1. Use say runif(n,5,10) to change the range
.(Use examples from the Integer keyboard to understand the code needed to produce the "n" above and in other examples.)
e) normal is rnorm(n) with tooltip
Random sample from the standard normal distribution. Use, say rnorm(n,100,15) to change the mean and sd
.f) uni-integer is sample.int(5, n,replace=TRUE) with tooltip
Random integers between 1 and 5. Use say sample.int(3,n,TRUE,prob=c(6,3,1)) to sample 1 to 3 with defined probabilities.
g) bernoulli is rbinom(n,1,prob=0.5) with tooltip Random Bernoulli (0 or 1) sample. Use say rbinom(n,1,1/6) for a random sample of a given dice value.
h) binomial is rbinom(n,3,prob=0.5) with tooltip
Random binomial sample with values between 0 and 3. Use say rbinom(n,5,prob=0.1) for other distributions
.i) poisson is rpois(n,lamda=1) with tooltip:
Random Poisson sample with mean 1. Change the mean as required.
j) negative binomial is rnbinom(n,size=1,prob=0.5) tooltip Random geometric sample as given, i.e. number of failures before size=1 success. Change value of size (must remain positive) for other negative binomials.
k) gamma is rgamma(n,shape=1,scale=2) tooltip
Random sample with shape=1 is from the exponential distribution with mean 2. Keep scale (>0) = 2 and change shape (>0) to 0.5 for chi-square distribution with 1d.f. or to 5, for 10 d.f. Keep scale = 2 for chi-square. l) beta is rbeta(n,shape1=1,shape2=1) With tooltip "This special case is the uniform distribution between 0 and 1. Change shape1 > 0 and shape2 > 0 for different beta distributions. m) sample is sample( ,n,replace=TRUE)
Random sample with replacement, from a given variable. Change replace to FALSE for a random permutation.
The text was updated successfully, but these errors were encountered: