9 descriptivestats文档格式.docx
- 文档编号:21632116
- 上传时间:2023-01-31
- 格式:DOCX
- 页数:59
- 大小:57.46KB
9 descriptivestats文档格式.docx
《9 descriptivestats文档格式.docx》由会员分享,可在线阅读,更多相关《9 descriptivestats文档格式.docx(59页珍藏版)》请在冰豆网上搜索。
13
4
36
8
126
15
61
102
65
152
206
63
240
100
568
625
Ifthedatavaluesthatyouwanttodescribearediscrete(forexample,thecolorofpeople'
seyes),thenyoucanusetheFREQproceduretoshowthedistributionofthesevalues,suchaspercentagesandcounts.
Eye
Color
Frequency
Percent
Cumulative
Brown
92
58.60
Blue
41.40
157
100.00
ThislessonwillshowyouhowtousetheMEANS,SUMMARY,andFREQprocedurestodescribeyourdata.
TimetoComplete
Thislessoncontains41pagesandtakesapproximately1hourtocomplete.
Objectives
Inthislesson,youlearnto
∙determinethen-count,mean,standarddeviation,minimum,andmaximumofnumericvariablesusingtheMEANSprocedure
∙controlthenumberofdecimalplacesusedinPROCMEANSoutput
∙specifythevariablesforwhichtoproducestatistics
∙usethePROCSUMMARYproceduretoproducethesameresultsasthePROCMEANSprocedure
∙describethedifferencebetweentheSUMMARYandMEANSprocedures
∙createone-wayfrequencytablesforcategoricaldatausingtheFREQprocedure
∙createtwo-wayandn-waycrossedfrequencytables
∙controlthelayoutandcomplexityofcrossedfrequencytables.
Prerequisites
Beforetakingthislesson,youshouldcompletethefollowinglessons:
∙BasicConcepts
∙UsingtheProgrammingWorkspace
∙ReferencingFilesandSettingOptions
∙EditingandDebuggingSASPrograms
∙CreatingListReports
∙CreatingSASDataSetsfromRawData
∙UnderstandingDATAStepProcessing
∙CreatingandApplyingUser-DefinedFormats.
ComputingStatisticsUsingPROCMEANS
Descriptivestatisticssuchasthemean,minimum,andmaximumprovideusefulinformationaboutnumericdata.TheMEANSprocedureprovidestheseandotherdatasummarizationtools,aswellashelpfuloptionsforcontrollingyouroutput.
ProcedureSyntax
TheMEANSprocedurecanincludemanystatementsandoptionsforspecifyingneededstatistics.Forsimplicity,let'
sconsidertheprocedureinitsbasicform.
Generalform,basicMEANSprocedure:
PROCMEANS<
DATA=SAS-data-set>
<
statistic-keyword(s)>
<
option(s)>
;
RUN;
where
∙SAS-data-setisthenameofthedatasettobeused
∙statistic-keyword(s)specifythestatisticstocompute
∙option(s)controlthecontent,analysis,andappearanceofoutput.
Initssimplestform,PROCMEANSprintsthen-count(numberofnonmissingvalues),themean,thestandarddeviation,andtheminimumandmaximumvaluesofeverynumericvariableinadataset.
procmeansdata=perm.survey;
run;
Item1
Item2
Item3
Item4
Item5
Item6
Item7
Item8
Item9
Item10
Item11
Item12
Item13
Item14
Item15
Item16
Item17
Item18
3.7500000
3.0000000
4.2500000
3.5000000
2.7500000
3.2500000
2.5000000
1.2583057
1.6329932
0.5000000
1.2909944
1.8257419
1.5000000
1.4142136
1.9148542
1.1547005
2.0000000
1.0000000
4.0000000
5.0000000
SelectingStatistics
ThedefaultstatisticsthattheMEANSprocedureproduces(n-count,mean,standarddeviation,minimum,andmaximum)arenotalwaystheonesthatyouneed.Youmightprefertolimitoutputtothemeanofthevalues.Oryoumightneedtocomputeadifferentstatistic,suchasthemedianorrangeofthevalues.
Tospecifystatistics,includestatistickeywordsasoptionsinthePROCMEANSstatement.WhenyouspecifyastatisticinthePROCMEANSstatement,defaultstatisticsarenotproduced.Forexample,toseethemedianandrangeofPerm.Surveynumericvalues,addtheMEDIANandRANGEkeywordsasoptions.
procmeansdata=perm.surveymedianrange;
Median
Range
ThefollowingkeywordscanbeusedwithPROCMEANStocomputestatistics:
DescriptiveStatistics
Keyword
Description
CLM
Two-sidedconfidencelimitforthemean
CSS
Correctedsumofsquares
CV
Coefficientofvariation
KURTOSIS
Kurtosis
LCLM
One-sidedconfidencelimitbelowthemean
MAX
Maximumvalue
MEAN
Average
MIN
Minimumvalue
Numberofobservationswithnonmissingvalues
NMISS
Numberofobservationswithmissingvalues
RANGE
SKEWNESS
Skewness
STDDEV/STD
Standarddeviation
STDERR
Standarderrorofthemean
SUM
Sum
SUMWGT
SumoftheWeightvariablevalues.
UCLM
One-sidedconfidencelimitabovethemean
USS
Uncorrectedsumofsquares
VAR
Variance
QuantileStatistics
MEDIAN/P50
Medianor50thpercentile
P1
1stpercentile
P5
5thpercentile
P10
10thpercentile
Q1/P25
Lowerquartileor25thpercentile
Q3/P75
Upperquartileor75thpercentile
P90
90thpercentile
P95
95thpercentile
P99
99thpercentile
QRANGE
Differencebetweenupperandlowerquartiles:
Q3-Q1
HypothesisTesting
PROBT
Probabilityofagreaterabsolutevalueforthetvalue
T
Student'
stfortestingthehypothesisthatthepopulationmeanis0
LimitingDecimalPlaces
Bydefault,PROCMEANSoutputautomaticallyusestheBESTw.formattodisplaynumericvaluesinthereport.
TheBESTw.formatisthedefaultformatthatSASusesforwritingnumericvalues.Whenthereisnoformatspecification,SASchoosestheformatthatprovidesthemostinformationaboutthevalueaccordingtotheavailablefieldwidth.Attimes,thiscanresultinunnecessarydecimalplaces,makingyouroutputhardtoread.
procmeansdata=clinic.diabetesminmax;
15.0000000
61.0000000
102.0000000
65.0000000
152.0000000
206.0000000
63.0000000
75.0000000
240.0000000
100.0000000
568.0000000
625.0000000
Tolimitdecimalplaces,usetheMAXDEC=optioninthePROCMEANSstatement,andsetitequaltothelengththatyouprefer.
Generalform,PROCMEANSstatementwithMAXDEC=option:
MAXDEC=n;
wherenspecifiesthemaximumnumberofdecimalplaces.
procmeansdata=clinic.diabetesminmaxmaxdec=0;
SpecifyingVariablesinPROCMEANS
Bydefault,theMEANSproceduregeneratesstatisticsforeverynumericvariableinadataset.Butyou'
lltypicallywanttofocusonjustafewvariables,particularlyifthedatasetislarge.Italsomakessensetoexcludecertaintypesofvariables.ThevaluesofID,forexample,areunlikelytoyieldusefulstatistics.
TospecifythevariablesthatPROCMEANSanalyzes,addaVARstatementandlistthevariablenames.
Generalform,VARstatement:
VARvariable(s);
wherevariable(s)listsnumericvariablesforwhichtocalculatestatistics.
varageheightweight;
Inadditiontolistingvariablesseparately,youcanuseanumberedrangeofvariables.
procmeansdata=perm.surveymeanstderrmaxdec=2;
varitem1-item5;
StdError
3.75
3.00
4.25
3.50
0.63
0.82
0.25
0.65
ThedatasetStudents.Bio1tracksclassroomdata.Itcontainsthefollowingvariables:
Name
Quiz1
ID
Quiz2
Absence
Test1
Project
Test2
Name,ID,andAbsencearecharactervariables;
therestarenumeric.WhichMEANSprocedurewillcomputetheupperquartileandvarianceforonlyproject,quiz,andtestscor
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- descriptivestats