[R] Trying to get around R
Charles C. Berry
cberry at tajo.ucsd.edu
Mon Nov 19 18:06:42 CET 2007
From the R Posting Guide:
Basic statistics and classroom homework: R-help is not intended
for these.
On Mon, 19 Nov 2007, Epselon wrote:
>
> I have three problems I am trying to simulate, that I am having difficulty
> getting around with.
>
> Problem 1.
> I want to determine the 85 percentile (the x value for which the sum of
> probabilities becomes 0.85) of the following distributions (two binomials
> and a Poisson with rate Lmbda= np of the two binomials): X ~B(10, 0.3),
> Y~P(3) ,
> Z~B(30, 0.1). I want to show that that Y is a good approximation for Z but
> not for X...(by examining these distributions for few
> different percentiles)
>
> Problem 2:
> For a binomial distribution X ~ B(20, 0.4), I want to use R to calculate
> P{|X − μ| < 2} and verify that it is near or larger than 0.95. (Hint from
> the text book: Since μ = 8 and 2.3 then you may want to read the
> weights, or probabilities, of the values 6:10, into a vector v and then use
> the command sum(v) to
> calculate the sum.) Repeat this for another set of parameters of your
> choice.
>
> Problem 3:
> Draw a sample of size 10, from a Poisson with Lambda= 5, and calculate the
> mean and the standard deviation of this sample, Repeat this calculation with
> size 20 and 30 and demonstrate
> that ¯X gets closer to μ as the sample size increases.
>
> Thanks.
>
> I would appreciate it if someone accompanied the codes with a brief
> explanation so I can be able to replicate it myself.
> --
> View this message in context: http://www.nabble.com/Trying-to-get-around-R-tf4837183.html#a13838643
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901
More information about the R-help
mailing list