Hello, I would be super grateful for some help with the following scenario
Maternal obesity is considered to influence birthweight of an infant, there is observational evidence to suggest that infants’ born to women with a high maternal BMI have a higher birthweight. This could be investigated by categorising the calculated maternal pre-pregnancy BMI into obesity classes (I, II, III) and then comparing these three categories with infant birthweight. Obtain histograms for infant birthweight for the obesity classes. What is the Stata code? What do the results show?
I have used the following to categorise:
generate bmiclass=.
(1,000 missing values generated)
replace bmiclass = 1 if BMI>30 & BMI<35
(524 real changes made)
replace bmiclass = 2 if BMI>34 & BMI<39
(340 real changes made)
.replace bmiclass = 3 if BMI>39
(232 real changes made)
The issue is when I try to create a histogram- I get this message:
twoway histogram neo_birthwgt, start (1500) width (500) by ( bmiclass)
option by() not allowed
My query relates to how else I would produce a histogram of BMI class against infant birth weight
Thanks
Related Posts with categorizing continuous data
Identify neighboring counties for treatment year and subsequent 2 yearsDear Stata users, I am working on a dataset of firms located in US counties for the years 2000-2018 …
Coefficients of multinomial logit vs seperate logistic regressionsDear Statalist users, I have a question which I could not clarify in my mind: What is the relations…
Gini indexHello Statalist, hope everyone is well I want to calculate Gini index using following equation: Arr…
asdoc + xtdidregress not workingHi Statalists! I wonder if someone else have a problem using asdoc together with the new xtdidregre…
For loop for each observation in a variableHi, Code: * Example generated by -dataex-. For more info, type help dataex clear input byte(date i…
Subscribe to:
Post Comments (Atom)
0 Response to categorizing continuous data
Post a Comment