Basic syntax for commands.ppt
《Basic syntax for commands.ppt》由会员分享,可在线阅读,更多相关《Basic syntax for commands.ppt(27页珍藏版)》请在麦多课文档分享上搜索。
1、Computing for Research I Spring 2013,Primary Instructor: Elizabeth Garrett-Mayer,Stata Graphics February 12,Basic syntax for commands,prefix: command varlist, optionsExamples: regress y x, level(90) by race: sum y x, detail ttest y, by(x) unequal,Stata Graphics,Maybe we can just end class now! Check
2、 out these links: http:/www.ats.ucla.edu/stat/stata/library/GraphExamples/default.htm http:/www.ats.ucla.edu/stat/stata/topics/graphics.htm http:/data.princeton.edu/stata/graphics.html http:/ univariate displays,Boxplots Stem and leaf Histograms Density plots,Ceramide Data,Lets look at the ceramide
3、markers What are their distributions? Are there outliers? Should we consider taking logs, or using % change?Results of a phase II trial of gemcitabine plus doxorubicin in patients with recurrent head and neck cancers: serum C-ceramide as a novel biomarker for monitoring response. Saddoughi SA, Garre
4、tt-Mayer E, Chaudhary U, OBrien PE, Afrin LB, Day TA, Gillespie MB, Sharma AK, Wilhoit CS, Bostick R, Senkal CE, Hannun YA, Bielawski J, Simon GR, Shirai K, Ogretmen B. Clin Cancer Res. 2011 Sep 15;17(18):6097-105. Epub 2011 Jul 26.,Histogram,hist c18,Lets make it prettier,* prettier histograms hist
5、 c18 , freq xaxis(1 2) ylabel(0(2)24) xlabel(20 “Twenty“ 40 “Forty“)hist c18, title(“Histogram of C18 Ceramide“) subtitle(“PI: K. Shirai“)hist c18, ytitle(“number of patients“) freq yline(0(10)20)hist c18, xaxis(1 2) xlabel(19.6 “mean“ 11.9 “median“, axis(2) grid),finding help on these can sometimes
6、 be tricky! e.g. help axis_choice_options,Boxplots,graph box c18,Boxplots,graph box c18, by(cycle) graph box c18, over(cycle)tab cycle graph box c18 if cycle7, over(cycle)sort patient cycle merge m:1 patient using “Ptdata.GemDox.dta“ graph box c18 if cycle7, over(cycle) over(gender)graph hbox c18, o
7、ver(initial) capsize(5),graph hbox c18, over(initial) capsize(5),graph hbox c18, over(initial) medtype(marker)medmarker(msymbol(+) msize(large)graph hbox c18, over(initial) ytitle(“C18”),Labels,Sometimes xlabels cannot be applied (e.g. boxplots) need to label your values Example: cycle for boxplotsl
8、abel define cycle 1 “cycle 1“ 3 “cycle 3“ 5 “cycle 5“ 7 “cycle 7“ label values cycle cycle graph box c18 if cycle7, over(cycle) (Hint: use this on the homework!),Stem and Leaf,. stem c18Stem-and-leaf plot for c18ceramide (C18 ceramide)c18ceramide rounded to nearest multiple of .1 plot in units of .1
9、0* | 42,43,44,460* | 57,57,67,81,89,90,96,98,99,991* | 01,06,08,08,14,15,19,20,35,441* | 622* | 03,15,16,18,19,19,222* | 823* | 173* | 4* | 23,494* | 58,68,685* | 5* | 6* | 376* | 86,Dotplot,Excellent way to show data across groups when you have a relatively small dataset dotplot y, over(group) dotp
10、lot c18, over(cycle) dotplot c18, over(gender) dotplot c18, over(gender) nogroup dotplot c18, over(gender) nogroup jitter(3) dotplot c18, over(gender) nogroup median center,Dotplot, by gender,Scatterplots,Two way graph Syntax: graph twoway scatter y x1 x2 graph twoway scatter y x1 Example: graph two
11、way scatter c18 totalceramide,Regression example,Scatterplot Residual plots Leverage Fitted line with raw data,Code,graph twoway scatter c18 totalcer regress c18 totalcer* residual plot * (residual vs. fitted) rvfplot* the long way * 1. generate a new variable from the regression, residuals predict
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BASICSYNTAXFORCOMMANDSPPT
