I have a dataset with 3500 companies. Each company has a unique company ID (variable name is id), which is all number (To be precise, the data type is long $12.0g when I use inshee to load the data).
I can use reg y x i.id
I also tried
tostring id, gen(id2)
encode id2, gen(id2_c)
then
reg y x i.id2_c
I thought the two should have given me the identical result on x, but the fact is they are not. I am puzzle why is that. Your help would be greatly appreciated.
Related Posts with Treat numeric variables as factor variables
Sum individuals' totals into a group sum?Hi statalist, I have a tricky problem in which I have a large set of individuals, with individuals b…
test post for code entry Code: *====================================================================* *WIERSEMA & BOWEN…
P-interactionHow to obtain p-interaction from the model? For example, I would like to see whether age has an inte…
Suggestion: more ML optimizers, inc. LM-BFGSI would like to suggest that StataCorp implement more ML optimizers, if they are not already conside…
Help debugging error message in user generated Stata codeHello friends, I am working int Stata/SE 15.1 to replicate a user-contributed command published in …
Subscribe to:
Post Comments (Atom)
0 Response to Treat numeric variables as factor variables
Post a Comment