Stat 406 - Example R programs
R programs that have been discussed in class are included
Other R resources:
- 16 Jan 2018: Using R, using sp, and mapping
- 18 Jan: spatial sampling
- sample.r How to draw random samples
- simsample.r Illustration of using simulation to evaluate properties
- 20 Jan: for HW 1
- Y.r Defines Y() used in HW 1, problem 4
- 25, 31 Jan: areal data
- areal1.r Defining neighbors and estimating spatial correlation.
Updated location of the Auckland shape file.
- areal3.r Fitting linear models with spatially correlated observations
- areal2.r Spatial smoothing, emphasizing Gaussian data
- 13, 15 Feb: geostatistical data
- prediction1.r R code and comments for inv. dist. weighting and trend surfaces.
- prediction2.r R code and comments for ordinary kriging 'by hand'.
- prediction3.r R code and comments for semivariogram estimation.
- R matrix.pdf Notes on read various data formats into R and working with matrices.
- 20, 22 Feb: geostatistical data, part 4
- prediction4.r R code and comments for fitting a variogram model and ordinary (simple, universal) kriging
- prediction5.r R code and comments for other types of kriging
- prediction6.r cokriging - placeholder in case sufficient class interest
- symbols.r Adding points or polygons to a spplot
- 6, 8 Mar: spatial linear models, part 5
- alliance.r Fitting ANOVA with spatial correlations, usign lsmeans library for ANOVA followup
- alliance.sas SAS code to fit ANOVA with spatial correlations