| fakeHappiness | R Documentation |
Fake Data on Happiness
Description
This is a toy ("fake") data set I might use to illustrate the so-called curvilinear effect of age on happiness.
Usage
fakeHappiness
Format
A data frame with 1000 observations on the following 8 variables.
agea numeric vector for age.
femalea numeric that equals 1 if the respondent is a woman
collegeeda numeric vector that equals 1 if the respondent says s/he has a college degree
famincra numeric vector for the respondent's household income. Ranges from 1 to 12.
bornagaina numeric vector for whether the respondent self-identifies as a born-again Christian.
erandom noise, generated from a normal distribution with a mean of 0 and a standard deviation of 3
happyan arbitrary happiness variable. See details for its construction
z_happythe same arbitrary happiness variable, scaled to have a mean of 0 and a standard deviation of 1. This makes it seem more "latent".
Details
Data are randomly sampled from the TV16 data set in the same package
for the age, female, college education, family income, and born-again variables.
Thereafter, I created an arbitrary "happiness" variable that is equal to
100 - .95*age + .01*(age^2) + .25*female + .05*famincr + .1*bornagain + e. The
data are not supposed to be realistic, per se. They're supposed to be functional for this
purpose.