Professional Documents
Culture Documents
Psychstatistics
Trying to be thoughtful
Home
Current Research
Tutorials
Blog
Graphing Distributions
This post will demonstrate how:
twowayfunctiony=normalden(x),range(44)xtitle("{it:x}")///
ytitle("Density")title("StandardNormalDistribution")
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 1/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
The choice of -4 and 4 as upper and lower bounds is arbitrary. You can connect the
three graphs by using a double pipe, || , between calls to the twowayfunction
command. We will shade the area under the curve for #1 and #3 using the
recast(area) option of twowayfunction . We will assign the color of the
shading to dark navy blue using the color(dknavy) option. We will leave the area
under the curve for #2 unshaded.
twowayfunctiony=normalden(x),range(1.961.96)color(dknavy)||
///
functiony=normalden(x),range(41.96)recast(area)color(dknavy)
||///
functiony=normalden(x),range(1.964)recast(area)color(dknavy)
///
xtitle("{it:x}")///
ytitle("Density")title("CritialValuesforStandardNormal")///
subtitle("Twotailedtestand{&alpha}=.05")///
legend(off)xlabel(1.9601.96)
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 2/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
twowayfunctiony=normalden(x),range(41.64)color(dknavy)||///
functiony=normalden(x),range(1.644)recast(area)color(dknavy)
///
xtitle("{it:x}")///
ytitle("Density")title("CritialValuesforStandardNormal")///
subtitle("Onetailedtestand{&alpha}=.05")///
legend(off)xlabel(01.64)
twowayfunctiony=tden(20,x),range(2.092.09)color(dknavy)||///
functiony=tden(20,x),range(42.09)recast(area)color(dknavy)||
///
functiony=tden(20,x),range(2.094)recast(area)color(dknavy)///
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 3/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
xtitle("{it:x}")///
ytitle("Density")title("CritialValuesfor{it:t}distributionwit
h20df")///
subtitle("Twotailedtestand{&alpha}=.05")///
legend(off)xlabel(2.0902.09)
Related Posts
LKJ Priors 27 Dec 2014
Beginning and Advanced SEM 14 Nov 2013
Predicted Scores and Residuals in Stata 01 Oct 2013
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 4/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
0Comments Psychstatistics
1 Login
Startthediscussion
Bethefirsttocomment.
ALSOONPSYCHSTATISTICS
Stata:DescriptiveStatisticsMean, LKJPriors
median,variability 1comment2yearsago
1comment2yearsago MarkusGesmannShortand
bestcourseworkwritingStudents insightfulpost.Thankyouverymuch!
especiallythosewhohaveasubject
relatedtothisthingcangainsome
newideasandinformationon
Subscribe d AddDisqustoyoursiteAddDisqusAdd Privacy
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 5/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 6/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 7/8
2/19/2017 Stata:GraphingDistributionsPsychstatistics
http://www.psychstatistics.com/2010/11/24/statagraphingdistributions/ 8/8