In: Statistics and Probability
We have a data set named "pp123" with the following variables, "highestgradecompleted", "earn," "age", and "agesquared."
Draft an R script with the following specifications (we aren't given the data file) and are asked just for the script.
Regress "earn" on "highestgradecompleted," "age," and "agesquared" such that it evaluates whether highestgradecompleted" has a discrete effect at particular thresholds: having 12 years of schooling ("highestgradecompleted" values equaling 12); having less than 12 ("highestgradecompleted" values < 12); and having more than 12 years of schooling ("highestgradecompleted" values > 12)