Dear Statalist,
I understand how to divide firms into industries and regress firms by industry, and how to divide firms into areas and regress firms by area. How to consider both industry and area? i.e., Regress firms by industry mean I can find other firms in the same industry, regress by area mean I can find other firms in the same area, how to consider both so that I can find other firms that are both in the same industry and area?
Here is my code that regresses by industry and by area respectively:
**by industry
reg var1 var 2 var3 if industry==1,r
outreg2 using "C:\Users\xxxx.doc",replace tstat bdec(3) tdec(3)
forvalues v= 2/13 {
reg var1 var 2 var3 if industry==`v',r
outreg2 using "C:\Users\xxxx.doc",append tstat bdec(3) tdec(3)
}
**by area
reg var1 var 2 var3 if eara==1,r
outreg2 using "C:\Users\yyyy.doc",replace tstat bdec(3) tdec(3) ctitle(East)
reg var1 var 2 var3 if eara==2,r
outreg2 using "C:\Users\yyyy.doc",append tstat bdec(3) tdec(3) ctitle(NorthEast)
reg var1 var 2 var3 if eara==3,r
outreg2 using "C:\Users\yyyy.doc",append tstat bdec(3) tdec(3) ctitle(Middle)
reg var1 var 2 var3 if eara==4,r
outreg2 using "C:\Users\yyyy.doc",append tstat bdec(3) tdec(3) ctitle(West)
I really appreciate any help you can provide.
Related Posts with regress by both industry and area
Weighted median and range with svy dataHi all, I'm hoping this is an easy response but I can't seem to find an answer to it. I'm working w…
why always (invalid nameHere is my code as shown below, when I run it, it always report error "( invalid name". Somebody ple…
Merge One Variable to Multiple Instances in Master DatasetHello, I have a dataset in which multiple organizations can serve the same county. I have a crosswa…
Generating dummy variables based on variables with multiple categoriesHi, I have a (panel) dataset that contains the following variables for each observation: person_id …
Interaction Term and Measuring the Impact of Pre- and Post-ReformDear Members, I have panel data, spanning between 2005 to 2015. I just want to measure the impact o…
Subscribe to:
Post Comments (Atom)
0 Response to regress by both industry and area
Post a Comment