Turtle
  1. Go to...
    1. Turtle's home page
    2. Stats and Data with R
    3. Biometry
    4. Data Analysis
    5. Further information
      1. C.V., etc.
      2. System dynamics
      3. JavaScript
      4. Sinai
      5. Java/JavasScript course
      6. C/C++ course
      7. Costa Rica

  1. PmWiki...
    1. WikiSandbox
    2. Basic Editing
    3. Documentation Index
    4. Cookbook (addons)
    5. installation problems


contact: yc@umn.edu




Part I Data in statistics and R

  • 1. Basic R
  • 2. Data in statistics and in R
  • 3. Presenting data

Part II Probability, densities and distributions

  • 4. Probability and random variables
  • 5. Discrete densities and distributions
  • 6. Continuous distributions and densities
  • 7. The normal and sampling densities

Part III Statistics

  • 8. Exploratory data analysis
  • 9. Point and interval estimation
  • 10. Single sample hypotheses testing
  • 11. Power and sample size for single samples
  • 12. Two samples
  • 13. Power and sample size for two samples
  • 14. Simple linear regression
  • 15. Analysis of variance
  • 16. Simple logistic regression
  • 17. Application: the shape of wars to come



« October 2009 period · December 2009 period »

November 2009
SunMonTueWedThuFriSat
01020304050607
08091011121314
15161718192021
22232425262728
2930     

Calendar:

  • No entries for November 2009.
Printable View

Chapter 7. The normal and sampling densities

Scripts:

  • areas-under-the-normal.R (add comments, etc. here)
  • cardiac.R (add comments, etc. here)
  • compare-normals.R (add comments, etc. here)
  • data-transformations.R (add comments, etc. here)
  • excercise-sampling-distribution.R (add comments, etc. here)
  • excercise-stiatistics-of-sampling-distribution.R (add comments, etc. here)
  • excercise-transformation.R (add comments, etc. here)
  • exercise-brown-bat.R (add comments, etc. here)
  • exercise-normal.R (add comments, etc. here)
  • expectation-variance-normal.R (add comments, etc. here)
  • kruger.R (add comments, etc. here)
  • midterm-K-S-test.R (add comments, etc. here)
  • normal-binomial-approximation.R (add comments, etc. here)
  • normal-discrete-approximation.R (add comments, etc. here)
  • normal-Poisson-approximation.R (add comments, etc. here)
  • normal-scores.R (add comments, etc. here)
  • normal.R (add comments, etc. here)
  • QQ-normal-beta-centered.R (add comments, etc. here)
  • QQ-normal-beta-left.R (add comments, etc. here)
  • QQ-normal-beta-right.R (add comments, etc. here)
  • QQ-normal-normal.R (add comments, etc. here)
  • sampling-density-intensity-murders-south.R (add comments, etc. here)
  • sampling-density-of-mean-Iraq.R (add comments, etc. here)
  • sampling-density-of-proportion-West-Bank.R (add comments, etc. here)
  • sampling-density-of-variance.R (add comments, etc. here)

Data:

  • cardiac.dta
  • casualties.rda
  • midterm.rda

Chapter comments

If you wish to comment about the book in general, click here.

If you wish to comment about this chapter...

Entries are sorted from most to least recent.

(:commentboxchrono:)





ljrqxktnc kxnpm? — 27 August 2008, 08:44

eqos ughmc yepz wrgp digtu nybi oyflcq

Douglas Bates — 20 December 2008, 14:17

I was unable to add a comment to the sampling-density-of-variance.R script discussion so I will add it here.

As I mentioned to Yosef, the fact that the first loop is slower than the others is almost entirely due to the vector v being initialized to a vector of length zero. If you replace the function s.loop with

s.loop1 <- function(R, n){ set.seed(10) v <- numeric(R) for(i in 1 : R) v[i] <- var(rexp(n)) v }

you will find that its speed is competitive with the others. The idiom that I prefer to teach is

set.seed(10) v <- replicate(R, var(rexp(n)))

It is also competitive in speed and I think it is more intuitive.

Douglas Bates — 20 December 2008, 14:19

I keep forgetting that this Wiki doesn't maintain line breaks. Without line breaks those samples of code should be

s.loop1 <- function(R, n){set.seed(10); v <- numeric(R); for(i in 1 : R) v[i] <- var(rexp(n)); v}

and

set.seed(10); v <- replicate(R, var(rexp(n)))

Page last modified on December 20, 2008, at 02:19 PM