Dear Statalisters,
I am new to stata. I have an unbalanced dataset on firms' investment and number of their patents. The issue here is one firm can have multiple investments in same year in different countries. So, I got an error while declaring panel data. I can't combine investment amount per year because I'd like to see the impact based on the countries economy (developed and non-developed). I need to set the time variable "yearly" because I will use lag efffect. I couldn't find the solution. Does anyone have idea on this kind of issue?
My data set looks like this:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(id year) int patcount str14 Destination double Investment int Jobscreated str1 div
1 2010 18 "Japan" 2000000 7 "E"
1 2014 16 "Vietnam" 82400000 1281 "E"
2 2010 40 "India" 8500000 284 "I"
2 2013 51 "Indonesia" 5700000 72 "I"
2 2013 51 "Singapore" 8600000 26 "G"
2 2014 6 "Canada" 6600000 36 "I"
2 2014 6 "United States" 21100000 125 "I"
2 2014 6 "United States" 21100000 125 "I"
3 2012 5 "Singapore" 22100000 20 "I"
3 2012 5 "Brazil" 1600000 20 "I"
3 2013 5 "United States" 17700000 58 "I"
3 2014 52 "United States" 3.000e+08 200 "I"
3 2014 52 "Brazil" 15400000 77 "I"
4 2014 3 "United Kingdom" 3000000 18 "I"
5 2015 59 "India" 20000000 500 "I"
6 2014 1334 "Germany" 56000 10 "E"
6 2016 10 "India" 4200000 13 "E"
7 2010 2 "Russia" 54100000 137 "E"
7 2010 107 "Russia" 54100000 137 "E"
7 2013 126 "United States" 58400000 128 "E"
end
Related Posts with Error while declaring panel data
How to standardize Stata variables format before using -append- ?I have around 40 files that I would like to append together. However, two variables named a12 and a1…
Specifying xtpmg optimal lags (2 3 1 2)dear community, i am having trouble specifying the optimal lags (2 3 1 2) chosen by AIC in my pmg mo…
Renaming each variable label as a substring of old labelI have a set of variables v1 through v154 that I want to relabel by excluding the first 16 character…
Reshape wide with missing observationsHello, I am trying to reshape wide the dataset below. Basically i would like the months (January th…
Can I define the cell contents of a table (or matrix)?New here, new to Stata (v17) I'm trying to create a table to later be exported to Excel. I would li…
Subscribe to:
Post Comments (Atom)
0 Response to Error while declaring panel data
Post a Comment