**************************************************************************** * --> Stata commands to display a graph of highest and lowest SIR-values * --> in occupations for a specific cancer site, with 95% confidence * --> intervals. **************************************************************************** * Stata clear set more off * --> User defined values *************************************************** local cancersite = 22 /* see list at end of this file */ local genderspec = "Men" /* Men or Women */ local hilownum = 5 /* number of high/low results on graph */ local ylabsize = 3 /* size of y labels */ local minobs = 0 /* only display results where observed > minobs */ local minexp = 0 /* only display results where expected > minexp */ local minSIR = 0 /* only display results where SIR > minSIR */ * --> User defined x-axis labels local xlab1 = 0.3 local xlab2 = 0.5 local xlab3 = 0.7 local xlab4 = 1.5 local xlab5 = 2.5 local xlab6 = 4.0 * --> user can change labnum and add additional labels over if required local labnum = 6 ****************************************************************************** * --> Reading data from internet ******************************************** local f "astra.cancer.fi/NOCCA/Incidence/Results/All-tables.csv" insheet using http://`f', delim(";") names clear * --> Apply the user choices ************************************************* keep if siteno == `cancersite' keep if gender == "`genderspec'" keep if totobs > `minobs' keep if totexp > `minexp' keep if totsir > `minSIR' * --> Sorting by SIR, keeping the highest and lowest numbers ***************** sort totsir drop if inrange( _n , `=`hilownum' + 1' , `=_N - ( `hilownum')' ) gen occsorted = _n * --> Building x-labels ****************************************************** forvalues n = 1/`labnum' { local lab`n'=ln(`xlab`n'') local x=`" `lab`n'' `" `xlab`n'' "' "' local X "`X' `x' " } * --> Building y-labels ****************************************************** local N = c(N) forvalues n = 1/`N' { local str = occtext[`n'] local obs = totobs[`n'] local y=`" `n' `" `str' (`obs') "' "' local Y "`Y' `y' " } * --> Generating logarithms ************************************************** replace totsir = ln(totsir) replace totci_lb = ln(totci_lb) replace totci_ub = ln(totci_ub) * --> Making scatterplot with caps ******************************************* local plottitle = sitetext local titlesize = `ylabsize'/1.5 #delim ; twoway scatter occsorted totsir if totsir <= 0 , mcolor(green) msymbol(O) msize(medium) || scatter occsorted totsir if totsir > 0, mcolor(red) msymbol(O) msize(medium) || rcap totci_lb totci_ub occsorted, hor lcolor(black) || , ysca(noline) xlabel(`X') ylabel(`Y', angle(hor) labsize(`ylabsize') glstyle(dot) glcolor(gs8)) legend(off) xline(0, lcolor(gs12)) title(The `hilownum' highest and lowest SIR values for `plottitle' with 95% confidence intervals, color(black) size(`titlesize')) ytitle("") xtitle("SIR") plotregion(fcolor(gs15) ) graphregion( fcolor("255 255 255") lc(white)) note(Pukkala et al. 2009) ; qui{ * --> List of cancer sites ************************************************** * 1 lip cancer * 2 cancer of the tongue * 3 cancer of the salivary glands * 4 cancer of the oral cavity * 5 cancer of the pharynx * 6 cancer of the oropharynx * 7 cancer of the nasopharynx * 8 oesophageal cancer * 9 adenocarcinoma of the oesophagus * 10 stomach cancer * 11 cardia cancer * 12 cancer of the small intestine * 13 colon cancer * 14 rectal cancer * 15 liver cancer * 16 hemangiosarcoma of the liver * 17 cancer of the gallbladder * 18 pancreatic cancer * 19 nasal cancer * 20 adenocarcinoma of the nose * 21 laryngeal cancer * 22 lung cancer * 23 adenocarcinoma of the lung * 24 small cell cancer of the lung * 25 squamous cell cancer of the lung * 26 other and unspecified lung cancer * 27 mesothelioma in the pleura/peritoneum * 28 breast cancer * 29 ductal breast cancer * 30 lobular breast cancer * 31 cancer of the cervix uteri * 32 cancer of the corpus uteri * 33 choriocarcinoma * 34 ovarian cancer * 35 cancer of the fallopian tube * 36 cancer of the vulva * 37 vaginal cancer * 38 prostate cancer * 39 testicular cancer * 40 testicular seminoma * 41 testicular non-seminoma * 42 cancer of the penis * 43 kidney cancer * 44 cancer of the renal pelvis * 45 cancer of the bladder. ureter. and urethra * 46 skin melanoma * 47 skin melanoma. upper limbs * 48 non-melanoma skin cancer * 49 non-melanoma skin cancer. upper limbs * 50 eye cancer * 51 malignant melanoma of the eye * 52 brain cancer * 53 glioma * 54 meningeoma * 55 thyroid cancer * 56 follicular thyroid cancer * 57 papillary thyroid cancer * 58 cancer of the glandula suprarenalis * 59 cancer of the glandula parathyreioeda * 60 cancer of the thymus * 61 cancer of the hypophysis * 62 cancer of the corpus pineale * 63 bone cancer * 64 chondrosarcoma * 65 soft tissue cancer * 66 fibrosarcoma * 67 liposarcoma * 68 other/unknown site * 69 non-Hodgkin lymphoma * 70 Hodgkin lymphoma * 71 multiple myeloma * 72 leukaemia * 73 chronic lymphatic leukaemia * 74 acute myeloid leukaemia * 75 mycosis fungoides * 76 borderline tumour of the ovary * 77 all malignant neoplasms ******************************************************************* *--> End Stata do-file ******************************************************************* }