Hello,
I am trying to create a new variable for BMI and I have a dataset with continuous variable "height" and another variable "htunits" recorded as cm or inches, and continuous variable "weight" with variable "wtunits" recorded as kg or lbs. When I attempt to convert all height values to m and weight to kg using the gen and replace commands I am getting an error "type mismatch"
Could anyone suggest syntax to do this properly?
Thanks in advance
Rene
Related Posts with Calculating BMI when ht and wt have been recorded with different units
Improving Code SpeedHello Statalist, After much blood sweat and tears I managed to successfully find a working solution…
Conditional drop if command within a certain firm year levelHi, I am working on my master thesis and I am currently busy with the data cleaning process. One of…
Missing Axis Labels only for some GraphsDear All I am working with a simple panel dataset of 40 individuals' characteristics over 2000 to 2…
Subgroups with coefplot allowing each graph to have its own scale and adjust location of legendDear all I am using the following code to create a graph with 5 plots: Code: coefplot (hba1c1, …
Spatial Panel Data TestsHello, I am relatively new to Stata and have been estimating different spatial panels, such as the …
Subscribe to:
Post Comments (Atom)
0 Response to Calculating BMI when ht and wt have been recorded with different units
Post a Comment