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
Agreement (kappa) Dear Statalisters, I have a 65 observation, we want to look at the variable only walking >=6 min…
help for line graphhi everyone, i have a data, see attachment, i want to get the line graph of variable BMI by differ…
Annual stock returnHey, I need your help. I need the follow variable "RETURN" in STATA. RETURN is the annual stock re…
brant can only be used after ologitHi everyone, Using brant subcommand, I am trying to test the parallel regression assumption. I am us…
Is it possible to use two datasets at once?Hey STATA noob here, I'm wondering if it's possible to use variables from two different datasets at…
Subscribe to:
Post Comments (Atom)
0 Response to STATA: panel regression, xtset error, CUSIP8-code, string variable
Post a Comment