stata初级入门3描述性统计指标.ppt

上传人:peixunshi0 文档编号:154609 上传时间:2025-07-12 格式:PPT 页数:21 大小:574KB
下载 相关 举报
stata初级入门3描述性统计指标.ppt_第1页
第1页 / 共21页
stata初级入门3描述性统计指标.ppt_第2页
第2页 / 共21页
stata初级入门3描述性统计指标.ppt_第3页
第3页 / 共21页
stata初级入门3描述性统计指标.ppt_第4页
第4页 / 共21页
stata初级入门3描述性统计指标.ppt_第5页
第5页 / 共21页
点击查看更多>>
资源描述

1、stata入门入门3统计指标篇统计指标篇江金启沈阳农业大学经济管理学院12 七月 2025计量经济学软件应用2一、基本描述统计量一、基本描述统计量lsummarize命令l可概括观测值个数、平均值、标准差、最大值和最小值五个指标。l语法:summarize varlist in if weight,optionsl选项:detail可统计方差、偏度、峰度和各个分位数等指标。l范例:summarize price mpg12 七月 2025计量经济学软件应用3l菜单:Statistics Summaries,tables,and tests Summary and descriptive sta

2、tistics Summary statistics12 七月 2025计量经济学软件应用4tabstat命令命令l语法:tabstat varlist if in weight,optionsl选项:默认结果是均值。lby(varname)按变量varname进行分组描述性统计;lstatistics(statname.)报告指定的描述性统计指标值。lnototal不报告总体统计值,通常是与by()配合使用 lmissing用by()选项时,显示by()变量的缺失值也作一类的结果。l范例:tabstat price mpg,by(id)statistics(mean ma mi sd n)m

3、issing12 七月 2025计量经济学软件应用5l菜单:StatisticsSummaries,tables,and testsTablesTable of summary statistics(tabstat)12 七月 2025计量经济学软件应用6ameans命令命令l估计算术、几何和调和平均数l语法:ameans varlist if in weight,optionsl范例:ameans price 12 七月 2025计量经济学软件应用7l菜单:Statistics Summaries,tables,and tests Summary and descriptive statis

4、tics Arith./geometric/harmonic means12 七月 2025计量经济学软件应用8二、单个分类变量的汇总统计二、单个分类变量的汇总统计ltabulate/tab1命令l对分类变量的描述统计是观察其不同类别的频数或百分数。l语法1:tabulate varname if in weight,optionsl语法2:tab1 varlist if in weight,optionsl选项:missing缺失值也作一类,plot作柱状图l范例:tabulate foreign/tab1 foreign id12 七月 2025计量经济学软件应用9l菜单1:Statist

5、ics Summaries,tables,and tests Tables One-way tables12 七月 2025计量经济学软件应用10l菜单2:Statistics Summaries,tables,and tests Tables Multiple one-way tables12 七月 2025计量经济学软件应用11三、两个分类变量的列联表三、两个分类变量的列联表l列联表是考察两个分类变量相关关系的方法l列联表给出从属于两个分类变量不同类别的观测值的频数l如果两个分类变量各有r,c个类别,则列联表共有rc个单元格12 七月 2025计量经济学软件应用12ltabulate命令:

6、l语法1指定两个变量的列联表ltabulate varname1 varname2 if in weight,optionsl范例:tabulate foreign id 12 七月 2025计量经济学软件应用13l菜单:Statistics Summaries,tables,and tests Tables Two-way tables with measures of association12 七月 2025计量经济学软件应用14l语法2多个变量内存在的所有可能列联分析结果ltab2 varlist if in weight,optionsl范例:tab2 foreign id rep7

7、812 七月 2025计量经济学软件应用15l菜单:Statistics Summaries,tables,and tests Tables All possible two-way tabulations12 七月 2025计量经济学软件应用16四、列联表描述统计量四、列联表描述统计量l tabulate,summarize():单个或两个分类变量的描述性统计l格式:tabulate varname1 varname2 if in weight,optionsl选项:no means(不)包含均值,no standard(不)包含标准差,no freq(不)包含频数,no obs(不)包含观

8、测值个数,missing将缺失值作为一类12 七月 2025计量经济学软件应用17l菜单:Statistics Summaries,tables,and tests Tables One/two-way table of summary statistics12 七月 2025计量经济学软件应用18五、经验分布函数五、经验分布函数l对变量累积分布函数的估计lcumul命令:通常与scatter(做散点图)一起使用l格式:cumul varname if in weight,generate(newvar)optionsl选项:freq使用频数作为累积分布l范例:cumul price,generate(cprice)l scatter cprice price12 七月 2025计量经济学软件应用19l菜单:Statistics Summaries,tables,and tests Distributional plots and tests Generate cumulative distribution六、正态性检验六、正态性检验lsktest varnamelswilk varname12 七月 2025计量经济学软件应用20本讲练习本讲练习12 七月 2025计量经济学软件应用21

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

宁ICP备18001539号-1