Statistics 471/701 Practice page
Statistics 471/701 practice page
This page keeps track of the practice in R you should be doing. I
won't collect it--but I'll assume you are confortable with using it.
I'll keep it in reverse cronological order. So hopefully, only the
first item or so are things you haven't done already. I'll keep both
the instructions here on this page and a running log of how I did it
in a .pdf file. To see the source, look at
the .Rnw file.
- Find some hetroskadastic data, or simulate it.
- Run a regular regression.
- Now change to a weighted least squares regression
- Plot both--which do you like better?
- Now transform to $Y/X$ and $1/X$. Do the fit again.
- Finally, do a log-log plot. Draw this fit on the ORIGINAL
coordinates to see the implied curvature.
- Save the regressions from a linear model (model = lm(y $~$
x) then resid <- model$residuals should work)
- Make a histogram of the residuals, and a qqplot. (Bonus if you
can glue them together.)
- Plot the residuals vs $X$.
- Fit a polynomial to them. Are the coefficients signficant?
- Week 2: Doglegs
- Make a dogleg
- Run a multiple regression on your orginal X and this new
- plot the resulting fit
- Now make a 2nd dogleg, and fit two bends
- Finally, square your dogleg to make a smooth bend
- First week of class:
- Let's walk through running a simple linear regression using R
- Grab a data set, say cleaning crews
- Now run a regression to fit this dataset (i.e. lm(RoomsClean ~ NumberOfCrews))
- Now rerun it without using the intercept term (i.e. lm(RoomsClean ~ NumberOfCrews) - 1)
- My sample R run. Here is
what it looks like as Rweave: .Rnw.
- Before class starts:
We will be using "google wave" this
semester. About 1/2 of you got accounts from me over break. If you
didn't, ask a classmate for an invite. Make a new wave and invite me
(firstname.lastname@example.org) Sivan (email@example.com) to the
Last modified: Thu Jan 28 10:36:12 EST 2010