Dear Forum
I am having problems with scaling the yaxis without compressing the graph - what am I doing wrong? (I just want the yaxis to fit my collapsed dataset)
Code:
preserve
replace avr_co_7 = avr_co_7*1000
drop if id==32
drop if id==25
**generating vars for plot
gen log1=log(avr_co_7)
collapse (mean) meanlog= log1 (mean) mean1=avr_co_7 (sd) sd1=log1 (count) n=log1, by(p3 strain)
generate hi_1 = meanlog + invttail(n-1,0.025)*(sd1 / sqrt(n))
generate low_1 = meanlog - invttail(n-1,0.025)*(sd1 / sqrt(n))
gen hi1 = exp(hi_1)
gen low1 = exp(low_1)
*graph bar mean1, over(p3) over(strain) name(p2, replace)
egen Group=group(strain p3)
replace Group=9 if Group==8
replace Group=8 if Group==7
replace Group=7 if Group==6
replace Group=6 if Group==5
**Figure
twoway (bar mean1 Group, barwidth(0.9)) ///
(rcap hi1 low1 Group) ///1"D2 ; FRL"
, xlabel(0 " " 1 "D2" 2 "P" 3 "E" 4 "D1" 5 " " 6 "D2" 7 "P" 8 "E" 9 "D1" 10 " ", noticks) ///
xtitle("GBC LPS" ) ytitle("ng/g brain") ysc(alt) ///
b1title("Estrous cycle effects") legend(off) note("Cytokines", bc(red)) ///
name(p6, replace)
restore
My attempt to rescale includes:
name(p6, replace) ysc(r(200)) ylabel(0[50]200)
(in the last line)
Thank You
I am having problems with scaling the yaxis without compressing the graph - what am I doing wrong? (I just want the yaxis to fit my collapsed dataset)
Code:
preserve
replace avr_co_7 = avr_co_7*1000
drop if id==32
drop if id==25
**generating vars for plot
gen log1=log(avr_co_7)
collapse (mean) meanlog= log1 (mean) mean1=avr_co_7 (sd) sd1=log1 (count) n=log1, by(p3 strain)
generate hi_1 = meanlog + invttail(n-1,0.025)*(sd1 / sqrt(n))
generate low_1 = meanlog - invttail(n-1,0.025)*(sd1 / sqrt(n))
gen hi1 = exp(hi_1)
gen low1 = exp(low_1)
*graph bar mean1, over(p3) over(strain) name(p2, replace)
egen Group=group(strain p3)
replace Group=9 if Group==8
replace Group=8 if Group==7
replace Group=7 if Group==6
replace Group=6 if Group==5
**Figure
twoway (bar mean1 Group, barwidth(0.9)) ///
(rcap hi1 low1 Group) ///1"D2 ; FRL"
, xlabel(0 " " 1 "D2" 2 "P" 3 "E" 4 "D1" 5 " " 6 "D2" 7 "P" 8 "E" 9 "D1" 10 " ", noticks) ///
xtitle("GBC LPS" ) ytitle("ng/g brain") ysc(alt) ///
b1title("Estrous cycle effects") legend(off) note("Cytokines", bc(red)) ///
name(p6, replace)
restore
My attempt to rescale includes:
name(p6, replace) ysc(r(200)) ylabel(0[50]200)
(in the last line)
Thank You
Comment