Randy Pruim
2013-May-18
A lot of times you end up putting in a lot more volume, because you are teaching fundamentals and you are teaching concepts that you need to put in, but you may not necessarily use because they are building blocks for other concepts and variations that will come off of that … In the offseason you have a chance to take a step back and tailor it more specifically towards your team and towards your players.“
Mike McCarthy, Head Coach, Green Bay Packers
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
— Antoine de Saint-Exupery
goal( ~ x, data = mydata )
goal( y ~ x | z , data = mydata )
goal( formula , data = mydata )
freqpolygon( ~age, data=HELPrct)
freqpolygon( ~age, data=HELPrct )
histogram( ~age, data=HELPrct )
densityplot( ~age, data=HELPrct )
bwplot( ~age, data=HELPrct )
qqmath( ~age, data=HELPrct )
xyplot( births ~ dayofyear, data=Births78)
bwplot( age ~ substance, data=HELPrct)
bwplot( substance ~ age, data=HELPrct)
histogram()
, qqmath()
, densityplot()
, freqpolygon()
xyplot()
, bwplot()
Create a plot of your own choosing.
Hints:
names(HELPrct)
i1 average number of drinks (standard units) consumed per day, in the past 30 days (measured at baseline)
i2 maximum number of drinks (standard units) consumed per day, in the past 30 days (measured at baseline)
names(Utilities2)
groups = ???
to overlay plots on top of each other.y ~ x | z
to create multipanel plots.densityplot( ~ age | sex, data=HELPrct,
group=substance,
auto.key=TRUE)
mean( ~ age, data=HELPrct )
[1] 35.65
favstats( ~ age, data=HELPrct )
min Q1 median Q3 max mean sd n missing
19 30 35 40 60 35.65 7.71 453 0
tally( ~ sex, data=HELPrct)
female male Total
107 346 453
sd( age ~ substance, data=HELPrct )
alcohol cocaine heroin
7.652 6.693 7.986
tally( sex ~ substance, data=HELPrct )
substance
sex alcohol cocaine heroin
female 0.2034 0.2697 0.2419
male 0.7966 0.7303 0.7581
Total 1.0000 1.0000 1.0000
tally( ~ sex + substance, data=HELPrct )
substance
sex alcohol cocaine heroin Total
female 36 41 30 107
male 141 111 94 346
Total 177 152 124 453
Create a numerical summary of your own choosing.
Hints:
names(HELPrct)
i1 average number of drinks (standard units) consumed per day, in the past 30 days (measured at baseline)
i2 maximum number of drinks (standard units) consumed per day, in the past 30 days (measured at baseline)
names(Utilities2)
mean()
, median()
, min()
, max()
, sd()
, var()
, favstats()
, etc.Linear models (regression, ANOVA, etc.) follow the same template:
lm ( formula, data=mydata )