---------------------------------------------------------------------------------------------------------------------------------- name: log: C:\Users\rwr\Dropbox\basu-house\build\code\../temp/cum_tight_experiment.log log type: text opened on: 17 Jul 2016, 17:07:44 . /**************************************************************************/ > > /* calculate the average length of a job cycle */ > use `myoutput'nlsy_data, clear; . summ cycle_lengthm, d; length of job cycle in months ------------------------------------------------------------- Percentiles Smallest 1% 0 0 5% 0 0 10% 0 0 Obs 132,262 25% 0 0 Sum of Wgt. 132,262 50% 5.75 Mean 30.59899 Largest Std. Dev. 53.77748 75% 37.25 432.75 90% 96.5 439.5 Variance 2892.017 95% 147.25 442.25 Skewness 2.715679 99% 253.5 446.25 Kurtosis 11.67311 . svyset [pweight=csampweight]; pweight: csampweight VCE: linearized Single unit: missing Strata 1: SU 1: FPC 1: . svy: mean cycle_lengthm; (running mean on estimation sample) Survey: Mean estimation Number of strata = 1 Number of obs = 135,994 Number of PSUs = 135,994 Population size = 438,150,475 Design df = 135,993 --------------------------------------------------------------- | Linearized | Mean Std. Err. [95% Conf. Interval] --------------+------------------------------------------------ cycle_lengthm | 38.8881 .2599225 38.37865 39.39754 --------------------------------------------------------------- . matrix junk = e(b); . scalar avgcycle = junk[1,1]; . scalar list; avgcycle = 38.888096 . use `myoutput'regis_barnichon_data, clear; . /* each month represents four weeks, thus we need to multiply by 4 to > have consistent units */ > replace tightness = 4*tightness; (768 real changes made) . /* 4 weeks per month */ > /* trailing sum of cumulative tightness the length the average job cycle */ > scalar avgcycle = round(avgcycle); . gen cumtight = sum(tightness); . sort datem; . /* check */ > gen avg_cumtight = cumtight - cumtight[_n-3]; (3 missing values generated) . gen chk = tightness + L.tightness + L2.tightness; (2 missing values generated) . assert abs(avg_cumtight-chk)<0.001 if !missing(chk) & !missing(avg_cumtight); . drop avg_cumtight chk; . /* calculate "avg" cumulative for each month */ > rename cumtight temp; . gen cumtight = temp - temp[_n-avgcycle]; (39 missing values generated) . gen month = month(dofm(datem)); . keep if month == 6; (704 observations deleted) . /* on average a person is hired halfway throug the year */ > gen year = year(dofm(datem)); . keep year cumtight; . save `myoutput'`prg'_data, replace; (note: file ../output/cum_tight_experiment_data.dta not found) file ../output/cum_tight_experiment_data.dta saved . log close; name: log: C:\Users\rwr\Dropbox\basu-house\build\code\../temp/cum_tight_experiment.log log type: text closed on: 17 Jul 2016, 17:07:45 ----------------------------------------------------------------------------------------------------------------------------------