Hi
I have made a graph in Stata and I created the y-axis labels using data from a number of variables:
by StudyID country (order), sort: generate y1 = _n == 1
tab y1
gen studylabel = Firstauthor if y1==1
replace studylabel = studylabel + ", " if y1==1 & (Gender !="" | Population_name != "")
replace studylabel = studylabel + Gender if Gender != ""
replace studylabel = studylabel + Population_name if Population_name != ""
replace studylabel = studylabel + " (n=" + n_string + ")" if n !=.
replace studylabel = studylabel + " (n not given)" if n ==.
sort order
g study = _n
labmask study, values (studylabel)
graph hbar AAbw, ///
over (MeanP501) bar(1, color(black)) bar(2, color(gs8)) ///
over(study, label(labsize(tiny))) ///
over(country, label(labsize(vsmall)) gap(400)) nofill ///
ytitle("Acrylamide (μg/kg bw/day)", size(vsmall)) ///
ysize(8) ///
xsize(5) ///
ylabel(0(0.1)0.9, labsize(vsmall)) ///
legend(size(vsmall)) ///
graphregion(color(white))
I have now been asked to show all "n" as "n", but I am not sure how I can convert part of the string-variable/label/axis-text to italics. I hope some of you might be able to help.
Best regards,
Amalie
Related Posts with Italics in part of string variable / y-axis labels
Shift values across columns (variables) to clean semi-regular parsing errorI'm using Stata 17 MP on a hosted application (Windows environment), though I'm running test code on…
Auto-ARIMA is now available in Stata! The new arimaauto and xtarimau commandsThanks to Kit Baum's relentless work on uploading new packages into the SSC, Stata now has auto-ARIM…
The new AUTOArima Mata class: you are free to use it if you want auto-ARIMA in your commandThanks to Kit Baum's adding the arimaauto command to the SSC, the class is publicly available after …
How to select categorical variable in Hoteck method to impute missing dataHello Everyone I am trying to address the missing values of four variables (price) in my research an…
Reshaping Data, Wide format from long Hello everyone, I'm having trouble formatting my data. I have a dataset that looks like this: Cou…
Subscribe to:
Post Comments (Atom)
0 Response to Italics in part of string variable / y-axis labels
Post a Comment