I want to see the effect of a law which came into effect on 1975 on the lnpatent (natural log of patent count) of treatment firms compared to that of the control firms. The dataset contains 4704 observations.
post==0 if appyear is 1972-1974 or post==1 if appyear is between 1976-1978. treatment=1 if the firm is publicly listed firm that files patents during the sample period and treatment=0 if its a private firm or govt. org that files a patent during the same period.
I have matched the treatment firms with control firms based on patent average of 1970-1971 from the same patentclass using the following command:
Code:
rangejoin avpatent 0 0.1 using controls, by(patentclass) suffix(_control)
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long assignee float(appyear post patentclass treatment lnpatent) long pair_num float avpatent 37335 1972 0 1 0 1.0986123 225 3.5 37335 1973 0 1 0 1.0986123 225 3.5 37335 1974 0 1 0 0 225 3.5 37335 1975 . 1 0 .6931472 225 3.5 37335 1976 1 1 0 1.3862944 225 3.5 37335 1977 1 1 0 1.0986123 225 3.5 37335 1978 1 1 0 0 225 3.5 355925 1972 0 1 1 1.0986123 225 3.5 355925 1973 0 1 1 1.609438 225 3.5 355925 1974 0 1 1 1.609438 225 3.5 355925 1975 . 1 1 1.609438 225 3.5 355925 1976 1 1 1 1.94591 225 3.5 355925 1977 1 1 1 1.94591 225 3.5 355925 1978 1 1 1 1.7917595 225 3.5 37335 1972 0 1 0 1.0986123 226 3.5 37335 1973 0 1 0 1.0986123 226 3.5 37335 1974 0 1 0 0 226 3.5 37335 1975 . 1 0 .6931472 226 3.5 37335 1976 1 1 0 1.3862944 226 3.5 37335 1977 1 1 0 1.0986123 226 3.5 37335 1978 1 1 0 0 226 3.5 356945 1972 0 1 1 1.3862944 226 3.5 356945 1973 0 1 1 1.3862944 226 3.5 356945 1974 0 1 1 1.94591 226 3.5 356945 1975 . 1 1 1.3862944 226 3.5 356945 1976 1 1 1 2.1972246 226 3.5 356945 1977 1 1 1 1.0986123 226 3.5 356945 1978 1 1 1 1.7917595 226 3.5 end
now if I want to declare the data as panel with the following command:
Code:
xtset assignee appyear
Code:
reghdfe lnpatent treatment##post, a(assignee appyear) vce( cluster assignee)
HTML Code:
repeated time values within panel r(451);
1. How can I make it a panel dataset?
2. If I want to compare the effect of the law on the treatment firms and control firms from each pair, how can I test that?
3. Even without declaring the sample as panel, I can run the reghdfe command. But will that be correct? I'm assuming it will compare the treatment firms with control firms without considering the pair.
My apologies for writing such a long post.
Kind Regards,
Syeda
0 Response to Panel dataset of Matched sample using rangejoin
Post a Comment