Hi,
I have a panel data of several branches of an organization over time. Variable newhire measures whether a new employee joined the branch in each week. I want to only keep observations that are within two weeks of an event of hiring in their branch.
I really appreciate it if you'd help me with this question.
Here's a small sample of my data:
I have a panel data of several branches of an organization over time. Variable newhire measures whether a new employee joined the branch in each week. I want to only keep observations that are within two weeks of an event of hiring in their branch.
I really appreciate it if you'd help me with this question.
Here's a small sample of my data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float year str8 week double newhire float(performance moderator id) 2015 "2015-2" 0 3.607143 3.360648 1 2015 "2015-3" 1 3.936667 3.390476 1 2015 "2015-4" 0 3.888889 3.75947 1 2015 "2015-6" 1 3.195238 3.6414285 1 2015 "2015-7" 0 3.934127 3.381349 1 2015 "2015-8" 0 4.1015873 3.081349 1 2015 "2015-9" 0 3.916667 3.836111 1 2015 "2015-11" 0 3.8466666 4.66 1 2015 "2015-12" 0 4.0466666 3.81 1 2015 "2015-13" 0 4.312143 3.354286 1 2015 "2015-14" 0 3.5666666 3.716667 1 2015 "2015-15" 1 4.4444804 4 1 2015 "2015-16" 1 4.0396824 4.1630955 1 2015 "2015-17" 0 4.122619 3.902778 1 2015 "2015-18" 0 4.038265 3.490476 1 2015 "2015-19" 0 4.0505953 3.5833335 1 2015 "2015-20" 0 3.992857 4.075 1 2015 "2015-21" 1 4.33109 3.145833 1 2015 "2015-22" 1 3.846032 3.666667 1 2015 "2015-23" 1 4.080357 3.708333 1 2015 "2015-24" 1 4.1833334 3.197619 1 2015 "2015-26" 0 4.0099206 3.8694444 1 2015 "2015-27" 0 3.736667 3.3933334 1 2015 "2015-29" 0 4.09 2.9285715 1 2015 "2015-30" 1 3.855612 3.870748 1 2015 "2015-31" 0 4.0311904 4.2066665 1 2015 "2015-32" 0 4.1977777 3.62 1 2015 "2015-33" 0 3.910238 3.8266666 1 2015 "2015-34" 0 3.7084656 3.888889 1 2015 "2015-35" 0 3.934524 3.340278 1 2015 "2015-36" 1 4.1435184 3.835714 1 2015 "2015-37" 0 3.734127 3.990476 1 2015 "2015-38" 0 4.2226853 3.336111 1 2015 "2015-39" 0 3.960979 3.6333334 1 2015 "2015-40" 0 4.080952 3.7857144 1 2015 "2015-41" 0 3.4761906 3.5 1 2015 "2015-42" 0 3.86 3.5766666 1 2015 "2015-43" 0 4.2190475 4.5208335 1 2015 "2015-44" 1 4.025 3.625 1 2015 "2015-45" 0 4.076667 3.8 1 2015 "2015-46" 0 4.035714 3.6438096 1 2015 "2015-47" 0 4.059307 3.909524 1 2015 "2015-48" 0 4.2110543 4.25 1 2015 "2015-49" 0 4.1475625 3.910544 1 2015 "2015-50" 0 4.0234694 4.054762 1 2015 "2015-51" 0 4.1306877 3.7305555 1 2015 "2015-52" 0 4.309921 4.1204762 1 2015 "2015-53" 0 4.0571427 3.93 1 2015 "2015-2" 1 4.201587 4.026786 2 2015 "2015-3" 0 4.024745 4.1367345 2 2015 "2015-4" 0 3.736364 3.2464285 2 2015 "2015-5" 0 3.8976514 3.6455026 2 2015 "2015-6" 0 3.893823 3.752551 2 2015 "2015-7" 0 3.89709 4.1236773 2 2015 "2015-8" 0 3.924762 3.669216 2 2015 "2015-9" 0 3.875794 3.822802 2 2015 "2015-10" 1 3.916766 4.0805554 2 2015 "2015-11" 0 3.981566 3.682381 2 2015 "2015-12" 1 3.720606 4.142491 2 2015 "2015-13" 0 3.672121 3.8128204 2 2015 "2015-14" 0 3.9285715 3.960227 2 2015 "2015-15" 0 3.711881 4.0375 2 2015 "2015-16" 0 3.665568 3.58 2 2015 "2015-17" 0 3.642857 4.1892858 2 2015 "2015-18" 1 3.579212 3.577778 2 2015 "2015-19" 1 3.5294695 4.186111 2 2015 "2015-20" 1 3.655789 3.722222 2 2015 "2015-21" 0 3.660385 4.258333 2 2015 "2015-22" 0 3.6055555 3.551389 2 2015 "2015-23" 1 3.73464 4.0894556 2 2015 "2015-24" 1 3.70754 4.1488094 2 2015 "2015-26" 1 3.4376984 4.0464287 2 2015 "2015-27" 1 3.5432575 3.7955556 2 2015 "2015-28" 1 3.704025 3.6812925 2 2015 "2015-29" 0 3.763546 3.795833 2 2015 "2015-30" 0 3.706061 4.076389 2 2015 "2015-31" 1 3.4234345 4.220476 2 2015 "2015-33" 1 3.7024956 3.962302 2 2015 "2015-35" 0 3.767677 4.1194444 2 2015 "2015-36" 0 4.1556826 4.1305556 2 2015 "2015-37" 1 4.1122694 4.2904763 2 2015 "2015-38" 1 4.15 4.346667 2 2015 "2015-39" 1 3.8907406 4.2738094 2 2015 "2015-40" 1 4.0149574 4.2940474 2 2015 "2015-41" 0 3.878628 4.4325395 2 2015 "2015-42" 1 3.78054 3.869709 2 2015 "2015-43" 1 3.9527116 4.1997356 2 2015 "2015-44" 0 3.748333 4.1738095 2 2015 "2015-45" 0 3.800144 4.196429 2 2015 "2015-46" 0 4.0257144 3.970476 2 2015 "2015-47" 0 3.983679 3.674206 2 2015 "2015-48" 0 3.9971154 4.099008 2 2015 "2015-49" 0 4.0386734 3.9484694 2 2015 "2015-50" 0 4.1584363 3.856944 2 2015 "2015-51" 0 3.695702 4.331741 2 2015 "2015-52" 0 4.1124654 4.2880955 2 2015 "2015-53" 0 4.0095525 3.782143 2 2015 "2015-2" 0 3.941587 4.127778 3 2015 "2015-3" 0 4.154422 4.1511903 3 2015 "2015-4" 0 3.911548 3.657407 3 end
Comment