Data
====

1. earnings.data.R
Data from a survey of adult Americans in 1994
  - N     : number of observations
  - earn  : earnings in dollars
  - height: in inches
  - male  : 1 for men and 0 for women

2. kidiq.data.R
  - N        : number of observations
  - kid_score: cognitive test scores of threeand four-year-old children
  - mom_hs   : did mother complete high school? 1: Yes, 0: No
  - mom_iq   : mother IQ score
  - mom_work : 1: mother did not work in first three years of child's life
               2: mother worked in second or third year of child's life
               3: mother worked part-time in first year of child's life
               4: mother worked full-time in first year of child's life 

3. mesquite.data.R
Total production (biomass) of mesquite leaves as function of easily measured
parameters of the plant, before actual harvesting takes place.
Two groups: 26 mesquite bushes and 20 mesquite bushes measured at a different
time of year.
  - N            : number of observations
  - canopy_height: height of the canopy
  - density      : plant unit density (# of primary stems per plant unit)
  - diam1        : diameter of the canopy (the leaf area of the bush)
                   in meters, measured along the longer axis of the bush
  - diam2        : canopy diameter measured along the shorter axis
  - group        : group of measurements (0 for the first group,
                 1 for the second group)
  - total_height : total height of the bush
  - weight       : leaf weight

4. nesYYYY.data.R
Data from the National Election Study
  - N           : number of observations
  - age_discrete: age category
                  1: 18-29
                  2: 30-44
                  3: 45-64
                  4: 65+
  - educ1       : education
                  1: no high school
                  2: high school graduate
                  3: some college
                  4: college graduate
  - gender      : 0 = male, 1 = female
  - income      : income percentile
                  1: 0-16th
                  2: 17-33rd
                  3: 34-67th
                  4: 68-95th
                  5: 96-100th
  - partyid7    : party identification
                  1: strong Democrat
                  2: Democrat
                  3: weak Democrat
                  4: independent
                  5: weak Republican
                  6: Republican
                  7: strong Republican
  - race_adj    : ethnicity
                  0  : white
                  1  : black
                  0.5: other
  - real_ideo   : political ideology
                  1: strong liberal
                  2: liberal
                  ...
                  7: strong conservative
  - year        : 1972 or 1976 or 1980 or 1984 or 1988 or 1992 or 1996 or 2000

Models
======

1. A simple regression, raw data
earn_height.stan: lm(earn ~ height)

2. Multiple predictors with interaction, raw data
kidiq_interaction.stan: lm(kid_score ~ mom_hs + mom_iq + mom_hs:mom_iq)

3. Centering
kidiq_interaction_c.stan: lm(kid_score ~ c_mom_hs + c_mom_iq 
                                         + c_mom_hs:c_mom_iq)
where:
  c_mom_hs = mom_hs - mean(mom_hs)
  c_mom_iq = mom_iq - mean(mom_iq)

4. Centering based on an understandable reference point
kidiq_interaction_c2.stan: lm(kid_score ~ c2_mom_hs + c2_mom_iq 
                                          + c2_mom_hs:c2_mom_iq)
where: 
  c2_mom_hs = mom_hs - 0.5
  c2_mom_iq = mom_iq - 100

5. Standardizing
kidiq_interaction_z.stan: lm(kid_score ~ z_mom_hs + z_mom_iq
                                         + z_mom_hs:z_mom_iq)
where:
  z_mom_hs = (mom_hs - mean(mom_hs)) / (2 * sd(mom_hs))
  z_mom_iq = (mom_iq - mean(mom_iq)) / (2 * sd(mom_iq))

6. Log transformations
log10earn_height.stan    : lm(log10(earn) ~ height)
logearn_height.stan      : lm(log(earn) ~ height)
logearn_height_male.stan : lm(log(earn) ~ height + male)
logearn_interacton.stan  : lm(log(earn) ~ height + male + height:male)
logearn_interacton_z.stan: lm(log(earn) ~ z_height + male + z_height:male)
                           z_height = (height - mean(height))/sd(height)
logearn_logheight.stan   : lm(log(earn) ~ log(height) + male)

7. Discrete predictor
kidscore_momwork.stan: lm(kid_score ~ as.factor(mom_work))

8. Models for prediction
mesquite.stan       : lm(weight ~ diam1 + diam2 + canopy_height + total_height
                                  + density + group)
mesquite_log.stan   : lm(log(weight) ~ log(diam1) + log(diam2) 
                                       + log(canopy_height) 
                                       + log(total_height) + log(density) 
                                       + group)
mesquite_va.stan    : lm(log(weight) ~ log(canopy_volume) 
                                       + log(canopy_area) + group)
mesquite_vas.stan   : lm(log(weight) ~ log(canopy_volume) + log(canopy_area)
                                       + log(canopy_shape) + log(total_height)
                                       + log(density) + group)
                       canopy_area = diam1 * diam2
                       canopy_shape = diam1 / diam2
mesquite_vash.stan  : lm(log(weight) ~ log(canopy_volume) + log(canopy_area)
                                       + log(canopy_shape) 
                                       + log(total_height) + group)
mesquite_volume.stan: lm(log(weight) ~ log(canopy_volume))
                      canopy_volume = diam1 * diam2 * canopy_height
