ConfidenceIntervals

# ConfidenceIntervals - > x = c(2.5 3.1 2.2 1.5 2.9>>...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ONE SAMPLE T-INTERVAL (95% CI) USING MINITAB MTB > set c1 DATA> 2.5 3.1 2.2 1.5 2.9 DATA> end MTB > Onet C1. One-Sample T: C1 Variable N Mean StDev SE Mean 95% CI C1 5 2.440 0.631 0.282 (1.657, 3.223) How to look up the critical t-value in Minitab (instead of using t-tables) MTB > InvCDF 0.025; SUBC> T 4. Inverse Cumulative Distribution Function Student's t distribution with 4 DF P( X <= x ) x 0.025 -2.77645 This yields the t-value with lower tail area of 0.025. Use its absolute value (2.776) for scale factor in confidence interval
ONE SAMPLE T-INTERVAL (95% CI) USING R (# are comments, not commands) > # Clear the workspace > rm(list=ls()) > > # enter the data
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: > x = c(2.5, 3.1, 2.2, 1.5, 2.9) > > # quick way (use built in function) > t.test(x, conf.int=0.95) One Sample t-test data: x t = 8.6484, df = 4, p-value = 0.0009833 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 1.656668 3.223332 sample estimates: mean of x 2.44 The long-way uses the same formulae as in class > # Long Way (step by step) > xbar = mean(x) > s=sd(x) > n=length(x) > se=s/sqrt(n) > tcrit=qt(0.025,n-1,lower.tail=F) > > me=tcrit*se > lowerbound=xbar-me > upperbound=xbar+me > > print(tcrit) [1] 2.776445 > print(lowerbound) [1] 1.656668 > print(upperbound) [1] 3.223332 > Note that the command “qt” provides for a way to get the critical values without using a table...
View Full Document

## This note was uploaded on 03/27/2012 for the course ECON 2280 taught by Professor Daniel during the Spring '12 term at Dalhousie.

### Page1 / 5

ConfidenceIntervals - > x = c(2.5 3.1 2.2 1.5 2.9>>...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online