stata和sas命令对比

stata和sas命令对比

ID:38165012

大小:30.95 KB

页数:12页

时间:2019-06-06

stata和sas命令对比_第1页
stata和sas命令对比_第2页
stata和sas命令对比_第3页
stata和sas命令对比_第4页
stata和sas命令对比_第5页
资源描述:

《stata和sas命令对比》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、已有556次阅读2010-5-810:56

2、个人分类:Stata

3、系统分类:科研笔记

4、关键词:SAS,STATASASStataInSASoperatorscanbesymbolsormnemonicequivalentssuchas:&orandFormanysituationsinSASorderdoesn'tmatter:<=canbe:==canbe:=>MostoperatorsarethesameinStataasinSAS,butinStataoperatorsdonothavemn

5、emonicequivalents. Forexample,youhavetousetheampersand( & )andnottheword"and".Thisworks:var_a>=1&var_b<=10wherethisdoesnot:var_a>=1andvar_b<=10ThesearetheoperatorsthataredifferentinStata:SymbolDefinition&and

6、or>=greaterthanorequalto<=lessthanorequalto==equ

7、ality(forequalitytesting)!=doesnotequal!not^powerNote: Symbolshavetobeintheordershown:">="not"=>"./*thisisacomment*/*thisisalsoacomment;/*thisisacomment*/*thisisalsoacomment//thisisacommentaswellTocontinueacommandtothenextline(linecontinuation):///youcanco

8、mmenthereaswellForexample:listidstategenderageincome///raceincomedateRangeofvalues:if1<=var_a<=10or:ifvar_ain(1,2,3,4,5,6,7,8,9,10)oralistofcharactervalues:ifstatein("NC","AZ","TX","NY","MA","CA","NJ")ifvar_a>=1&var_a<=10or:ifinrange(var_a,1,10)or:ifinlist

9、(var_a,1,2,3,4,5,6,7,8,9,10)oralistofstringvalues:ifinlist(state,"NC","AZ","TX","NY","MA","CA","NJ")Statahasalimitof10argumentstoinlist()(whichincludesthestringvariable)whentheargumentsarestrings. Morethanonevariablecanbespecified.Referencingmultiplevariab

10、lesatatime:Saythefollowingvariablesareinadatafileintheordershown:var1var2var3agevar4var5Thenyoucouldcodethemas:var1--var5ToSAS,thismeans"allvariablesthatarepositionallybetweenvar1andvar5,"whichwouldincludethevariableage.Referencingmultiplevariablesatatime:

11、var1-var5ToStata,thismeans"allvariablesthatarepositionallybetweenvar1andvar5." Noticethatthereisonlyonedash( - ).Referencingmultiplevariablesatatime:var1-var5isthesameas:var1var2var3var4var5nomatterthepositionsofthevariablesareintheobservation.Usingacolons

12、electsvariablescontainingthesameprefix:var:couldrepresent:var1var2var10variablevaryingvar_1Referencingmultiplevariablesatatime:var?Thequestionmark( ? )isawildcardthatrepresentsonecharacterinthevariablename. I

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。