User Tools

Site Tools


c:ms:2017:schedule:week15

This is an old revision of the document!


https://goo.gl/forms/x7NUmOxm2DxKmpd62

two sample t-test

x1 <- rnorm(10, mean=100, sd=15)
x1
t.test(x1, mu=95)
  1. What is the std error value?
  2. What if you have a sample with a large size?
    • How do you get your se?
ster <- sd(x1)/sqrt(length(x1))
difx <- mean(x1)-95
tvalue <- difx/ster

difx
ster
tvalue
x2 <- rnorm(100, mean=100, sd=15)
head(x2)
tail(x2)
t.test(x2, mu=95)

ster <- sd(x2)/sqrt(length(x2))
difx <- mean(x2)-95
tvalue <- difx/ster

difx
ster
tvalue
mtcars
mtcars$mpg
mtcars$am

t.test(mtcars$mpg~mtcars$am)

one sample t-test 2

a = c(65, 78, 88, 55, 48, 95, 66, 57, 79, 81)
mean(a)
sd(a)

t.test(a, mu=60)

Faired sample t-test

sleep

sleep.wide <- data.frame(
    ID=1:10,
    group1=sleep$extra[1:10],
    group2=sleep$extra[11:20]
)
sleep.wide

t.test(sleep.wide$group1 - sleep.wide$group2, mu=0, var.equal=TRUE)
t.test(sleep.wide$group1, sleep.wide$group2, paired=TRUE)

survey_ms_2017.sav

T-TEST GROUPS=gender(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=bigco smallco likeprog
  /CRITERIA=CI(.95).
T-TEST GROUPS=tend(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=bigco smallco likeprog
  /CRITERIA=CI(.95).
T-TEST GROUPS=tend(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=selfprom ethalright
  /CRITERIA=CI(.95).
T-TEST GROUPS=gender(1 2)
  /MISSING=ANALYSIS
  /VARIABLES=selfprom ethalright
  /CRITERIA=CI(.95).

ANOVA

Regression

c/ms/2017/schedule/week15.1497485310.txt.gz · Last modified: 2017/06/15 08:38 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki