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
Propensity score matchingwhen using propensity score matching approach which command on STATA should be used pscore, psmatch2…
Synthetic matching with Pre-Intervention Outcomes ONLYHi, I want to compare the treatment effect on the patent quantity produced by treatment and control…
Identifying outlier clustersHello everyone, I have an unbalanced panel data set which consists of 5000 banks operating in 38 co…
Portfolio construction Fama & FrenchHello This is not only a question about a code and you probably need to know the paper "A five-fact…
can one use MATA within an ML programI am trying to write a customize likelihood function, where I want to numerically integrate using MA…
Subscribe to:
Post Comments (Atom)
0 Response to STATA: panel regression, xtset error, CUSIP8-code, string variable
Post a Comment