Hello everyone,
I have two very simple questions:
1. I am trying to make a bar graph with two variables. The variables are meanEI and EER. It sounds simple, however, EER is a sum of two other variables: TEE and Eg.
I want to plot meanEI and stacked TEE and Eg.
I used the following code but it does not include anything relating to stack (see Graph.png). I want only Estimated TEE and Estimated Eg to be on top of each other.
2. I am trying to make a second graph of a variable with three categories. The following code is for count (to give you an idea of what I want) . See Graph2.png
When I tried using percentage instead of count, Stata gives me an error saying:
(ercent) invalid statistic
r(198);
I am wondering why Stata says "ercent" and not "percent". I used the following code:
Any help would be appreciated!
I have two very simple questions:
1. I am trying to make a bar graph with two variables. The variables are meanEI and EER. It sounds simple, however, EER is a sum of two other variables: TEE and Eg.
I want to plot meanEI and stacked TEE and Eg.
I used the following code but it does not include anything relating to stack (see Graph.png). I want only Estimated TEE and Estimated Eg to be on top of each other.
Code:
graph bar (mean) meanEI (mean) TEE Eg, over(description2) ytitle(Energy (kcal)) /// title(Figure: Mean EI and estimated energy expenditure (TEE+Eg) by age, size(med) /// justification(center)) legend(on) scheme(s2mono) graphregion(color(white)) /// legend(order( 1 "Mean reported EI" 2 "Estimated TEE" 3 "Estimated Eg")) legend(size(med)) /// note(*EI = Energy Intake; TEE = total energy expenditure; Eg = energy needs for deposition) /// b1title(Age (months))
Code:
graph bar (count) n, over( report_BC1_1sd) stack over(des) ascategory asyvars scheme(s1mono)
(ercent) invalid statistic
r(198);
I am wondering why Stata says "ercent" and not "percent". I used the following code:
Code:
graph bar (percent) n, over( report_BC1_1sd) stack over(des) ascategory asyvars scheme(s1mono )
Comment