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
How to correct the alignment of outputI am doing data cleaning and the output is hard to clean because of how it is coming out. For some t…
Boxplot in complex design surveyDear Statalist users: I have a data set with weight syntax as below, How can I run a box plot with …
Year and Month fixed effectsHi, I would like to run a regression with year month fixed effects. My data consists of year and mo…
cmp multivariate probitHi, I am running a multivariate probit model using the cmp function on 4 binary dependent variables…
Panel GARCH Model?Dear all, I am attempting to estimate a panel EGARCH-M model in STATA, as of yet I have had no luck…
Subscribe to:
Post Comments (Atom)
0 Response to STATA: panel regression, xtset error, CUSIP8-code, string variable
Post a Comment