我在大约120万次观测中运行了大约45,000个局部线性回归(基本上),所以我很感激一些帮助试图加快速度,因为我很不耐烦.
我基本上是在为一堆公司构建逐年工资合同 - 职能工资(给予公司,年份,职位的经验).
这是我正在使用的数据集(基本结构):
> wages
firm year position exp salary
1: 0007 1996 4 1 20029
2: 0007 1996 4 1 23502
3: 0007 1996 4 1 22105
4: 0007 1996 4 2 23124
5: 0007 1996 4 2 22700
---
1175141: 994 2012 5 2 47098
1175142: 994 2012 5 2 45488
1175143: 994 2012 5 2 47098
1175144: 994 2012 5 3 45488
1175145: 994 2012 5 3 47098
Run Code Online (Sandbox Code Playgroud)
我想为所有公司构建0到40经验水平的工资函数,a:
> salary_scales
firm year position exp …Run Code Online (Sandbox Code Playgroud) interpolation r linear-interpolation extrapolation data.table