Dear all,
I am trying to complete a panel data regression with the individual and time identifiers: company and year, respectively. I am using cusip8-codes as the company identifiers, which can be comprised of numbers and characters (e.g. 80306210 or 00484M10). In my dataset the cusip8 variable is a string variable. Therefore I get the following error when trying to set the panel identifiers:
. xtset cusip pyear
string variables not allowed in varlist;
cusip8 is a string variable
r(109);
I've tried to destring the variable but without any results:
. destring cusip8, replace
cusip8: contains nonnumeric characters; no replace
If I try the following formula (which I found on this forum) I end up with blanks (".") for all the cusip8's that contained a character.
. destring cusip, gen(cusip8) force
cusip: contains nonnumeric characters; cusip8 generated as double
(76235 missing values generated)
How can I fix this problem?
Kind regards,
Danielle
Related Posts with STATA: panel regression, xtset error, CUSIP8-code, string variable
Generating confidence interavals for likelihood ratio from 2x2 tableHello all, I am using Stata 16.0. I am working on a systematic review in which I have many predict…
correct endogeneity with two step residual inclusiongood morning, everyone, thank you for your answers which will be of great help to me and excuse me …
How to count the number of relevant variables present for an individualI have a multiple cross-sectional dataset, where I am trying to create the following index: Dit = (…
Labelling scatterplots with twoway commandHi all! I'd like to label each of these scatterplots accordingly. Code: twoway (scatter studentsa…
I need help on Data reshapinghello everybody, because I need to transfer the datasets from longitude to panel data, those are wha…
Subscribe to:
Post Comments (Atom)
0 Response to STATA: panel regression, xtset error, CUSIP8-code, string variable
Post a Comment