I have a string variable (Size) that contains numbers and characters. I want to subtract number and create new_var1 and subtract character and create new_var2. Which code do I have to use to get the results like below? Thank you.
SIZE NEW_VAR1 NEW_VAR2
0.13 AC 0.13 AC
2560 SF 2560 SF
2145 SF 2145 SF
1.12 AC 1.12 AC
Related Posts with Subtract number and character separately from a string variable
Using racial/ethnic demographics as the independent variables in multivariate linear regression?Hello! I am conducting multivariate linear regression using -regress- of Google trend interest (a 10…
Reshapes wide to long without wave identifierHi I have a follow-up tricky reshape that I would like some help with please. I would like to resha…
Using return matrix from polychoric correlationHello all, I am using stata version 17. I ran a polychoric correlation on about 100 variables. The…
Long Panel: I use AB but It is better PVAR or panel ARDL?Hello, My sample is 27 countries over the period 1970-2020. Code: * Example generated by -dataex-…
Cross-level interactions vs. separated regressions for categories of the interaction variable in multilevel modelsDear all, I want to investigate which child in a sibling group takes over the care of a parent. The…
Subscribe to:
Post Comments (Atom)
0 Response to Subtract number and character separately from a string variable
Post a Comment