Differences between revisions 1 and 2
Revision 1 as of 2023-06-09 14:31:07
Size: 424
Comment:
Revision 2 as of 2025-10-24 17:33:22
Size: 414
Comment: Rewrite
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''`recast`''' command coerces a variable into a different [[Stata/DataTypes|data type]]. '''`-recast-`''' coerces a variable into a different [[Stata/DataTypes|data type]].
Line 26: Line 26:
[[https://www.stata.com/manuals/dinspect.pdf|Stata manual for inspect]] [[https://www.stata.com/manuals/drecast.pdf|Stata manual for -recast-]]

Stata Recast

-recast- coerces a variable into a different data type.


Usage

recast str244 foo
recast double bar

If the coercion will be lossy, the force option is mandatory.


See also

Stata manual for -recast-


CategoryRicottone

Stata/Recast (last edited 2025-10-24 17:33:22 by DominicRicottone)