•1StataComputerResourceCenter198519981.11.21.31.41.52.02.13.03.14.05.06.0StataStataWORDStata640k3.1Stata2400994.0WINDOWSStata480099WINDOWS955.032M2trade()Stata20CoxWeibulllogisticPoissonStata(χ2)10•StataStatadisplaydisplay3+2271.abs(x)/*2.exp(x)/*3.log(x)/*4.log10(x)/*5.sqrt(x)/*6.sin(x)/*7.cos(x)/*8.atan(x)/*9.lngamma(x)/*xΓln[(x-1)!]10.mod(x,y)/*xydisplaymod(25,3)11.normprob(df,x)2.invnorm(p)3.Binomial(n,k,p)≥4.invbinomial(n,k,p)≥≥≥5.tprob(df,t)6.invt(df,P)•117.fprob(df1,df2,f)8.invfprob(df1,df2,p)9.chiprob(df,x)χ10.nchi(df,L,x)χ11.invnchi(df,L,p)χ12.gammap(a,x)13.invgammap(a,p)14.ibeta(a,b,x)15.uniform()16.invnorm(uniform())17.μ+σ×invnorm(uniform())μσ1.length(s)2.substr(s,n1,n2)3.string(n)4.real(s)5.upper(s)6.lower(s)7.index(s1,s2)8.trim(s)9.ltrim(s)10.rtrim(s)1.sign(x)x01,x0-1,x=002.int(x)x,int(x+0.5)xint(x+sign(x)/2)x3.sum(x)x(missingvalue)04.max(x1,x2,...,Xn)12•5.min(x1,x2,...,Xn)6.group(x)x,1,2,...,x7.float(x)xStata,,,x1.1,x1.1,x,1.1,0.00000002384,xfloat(1.1),,8.cond(x,a,b)x,x0()a,x0()b9.recode(x,x1,x2,...,xn):x1x=x1x2x1x=x2x3x2x=x3recode(x,x1,x2,,xn)=xn-1xn-2x=xn-1xnxxn-1x10autocode(x,ng,xmin,xmax)xmin,xmaxngx§StataDos8DosStata()2.1dctASCrawASCdodtaStatalogStatagphStataxpStataxpStata(AZa-z)(09)(_)•13=8StataStata_all_n_N_skip_b_coef_cons_pi_pred_rc_weightdoublefloatlongintinifusingwithStata254801_coef[]_b[]Coxlogitprobit[]_coef[drug[2]]coef[drug[2]*disease[1]]logistic[]()2_cons1_b[_cons]]3_N4_n5_pi6_rccaptureStata_result(#)Stata_result(#)_result(#)#n1,2,3,452.2_result(n)correlate14.2.5.131count1inspect15.26.37.48.14•describeordescribeusing14.25.36.cox,logit,orprobite1.3.24.χ2anova,regress,orstepwise16.F27.R238.R249.5,Factor1712823χ24χ25χ219136χ2Oneway15.26.F37.Bartlettχ248.Bartlettχ2Summarize19.25detail210.50detail311.75detail412.90detail513.95detail614.detail75detail15.detail810detail,Tabulate18.Fisher29.CramerV310.gamma4Pearsonχ211.gammaASSE5Pearsonχ212.tau-b6l.r.χ213.tau-bASSE7l.r.χ2,Test25.36.F4anova,•15stata+*/^xyyxyx)(/-x/y^(x-y)/(x*y)this+isthisisStata=====Stata10ASCIIStata&()|()Stata10×==2.3Statadisp2+”this”substr(string(20+2),1,1)+upper(substr(“rf”,1+1,1)“”“Zebra””cat”(2==2)+1(32)+132+132&54(32)&(54)16•generatereplacedisplaygeneratereplace2•()logisticlogisticProbitlogisticPoissonKaplan-MeierMantel-HaenszelWilcoxon-GehanCoxTobitWeibullkappaStataCholeskyKroneckerStata400×400(40×40)StataStataado()StatanλPoissonprogdefinerp/*setobs`2’/*setseed`3’/*genrp=./*rpPoissonlocallamda0=exp(`1’)/*lamda0=exp(λ)localj=1/*j=1while`j’`2’+1{/*jnjjPoisson•3locali=1/*i=1localr0=1/*r0=1while`i’0{/*ilocalr1=uniform()/*r1=localr0=`r1’*`r0’/*r0=r1*t0if`r0’`lamda0’{/*r0lamda0localn0=`i’-1/*n0=i-1locali=-1/*i=-1}locali=`i’+1/*i}quietreplacerp=`n0’if_n==`j’/*jrpn0localj=`j’+1/*j}end4•D:\Stata.exit.eclear(eexit)StataStata.exitWstataStataStataFile,exit,StataStataDatahaschangedwithoutbeingsaved.Doyoureallywanttoexit?()WINDOWSDOSStataStataWINDOWSStataStata•51.1x12345y45.56.27.78.5StataStatad:\mydata\ex1.dtad:mydataex1.dtaStatadtaStataStatausefiled:\mydata\ex1.dtaalreadyexistsreplaceStatad:mydataex1.dtaStata,6•Stata()logresult1Stata.log,(help)result1.loglogofflogonlogcloseresult1.loglogusingresult1result1.logresult1.logreplaceresult1.logEDITPE2WPSWORDDOStypeprintsaving1.1xyex1.gphyxd:\mydata\ex1.gph(gphStata)Statagraph•7usingd:\mydata\ex1FilePrintGraphgphdotDOSStataDOSgphdotStataStataStata1.21.3StataStataex1.logex1.dtaex1.gphStata8•StataStatahelp(F1)•91byvarlistvarlistgroup1234bygroup:Statagroup=1,group=2,group=3group=44sort,.sortgroup2weight[fw=][aw=]3ifexp,inrange~~44~(last)–forx1,x2,…,x2222y1,y2,…,y10,z1,…,z515yizix1,x2,…,x2215forfory1-y10z1-z5:regress@x1-x22forregress@Stataforx1-x22fory*:summ@,detailyStata•17StataStataStata4StataASCIIdbaseFoxbaseSASSPSSinput3.1x0x1Statainputx0x1Statax0x1EnterendStata18•StatalistStatasaved:\mydataex3-1.dtaStatadtaStataStatauseWindowsStataeditorStataeditStataEditor,StataStata1var1,2var2PreserverenameStata•19StataASCIIinfileusingASCIIWPS,PE2,EDIT,WORDWINDOWS3.13.2ex3-1.txtd:\mydata\(ASCII)Stata:saveinfiletransferDOSdbasefoxbaseStatafoxbaseStatatransferdbasefoxbase3.1ex3-1.dbfd:\mydata\,ex3-1.dbfStatatransferDOStransfertransfer20•Statatransfer1-2-3dbaseIIdbaseIIIFoxbaseSASSPSSSYSTATStataFoxbaseStata•21Stata8822•Stata88–[Enter]d:\mydata\ex3-1.dtaStatatransferStatausedescribeex3-1.dta,describeF3d:\mydata\ex3-1.dta472099(Stata1.1)2x0,x18x0x18ggef3.4Stata•23labelvardescribex0x1ex3-1.dtagroup1yes()0no()10labeldefinegroup10lablist24•StatalabeldataStatasortStata•25drop~keepkeepdropdropappendusing3.2ex3-2.dtaex3-1.dta43x0,x1ex3-1.dtagex3-2.dtaex3-1.dtaex3-1.dta26•Stata12()3()ex3-1.dtamergeusing3.3ex3-3.dtabh15ex3-4.dtabh1,3,4,6ex3-3.dtaex3-3.dta25bh=6ex3-3.dtaex3-4,dtaStata•27Stata_merge123_merge1_merge2_merge=3()……28•Statades402desfloat%9.0gStatagStataStataefxg_fmtg_fmte_fmtf_fmtg_fmte_fmtgformate_fmtf_fmt:listStata•29e%9.2e32.53.25e+013.253.25e+00f0.0000056%9.2f0.00gef1.1%9.2g1.10%9.1g1.1%9.0g1.1formatx%9sx930•Stata()describesummarycentilesummarize[][,detail]centi