Tek Örneklem t-Testi Uygulaması Nehir Seher 2026-05-15

(library(tidyverse))
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.0     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
##  [1] "lubridate" "forcats"   "stringr"   "dplyr"     "purrr"     "readr"    
##  [7] "tidyr"     "tibble"    "ggplot2"   "tidyverse" "stats"     "graphics" 
## [13] "grDevices" "utils"     "datasets"  "methods"   "base"
(library(dplyr))
##  [1] "lubridate" "forcats"   "stringr"   "dplyr"     "purrr"     "readr"    
##  [7] "tidyr"     "tibble"    "ggplot2"   "tidyverse" "stats"     "graphics" 
## [13] "grDevices" "utils"     "datasets"  "methods"   "base"
(library(lsr))
##  [1] "lsr"       "lubridate" "forcats"   "stringr"   "dplyr"     "purrr"    
##  [7] "readr"     "tidyr"     "tibble"    "ggplot2"   "tidyverse" "stats"    
## [13] "graphics"  "grDevices" "utils"     "datasets"  "methods"   "base"

Tek Örneklem T-Testi Bu çalışmada bir grubun ortalama stres düzeyinin 50’ye eşit olup olmadığı tek örneklem t testi ile incelenmiştir. Araştırmada bir grup bireyin stres puanları 40, 45, 50, 42, 47 ve 44 olarak alınmıştır. Bu değerler kullanılarak grubun ortalamasının 50 değerinden istatistiksel olarak anlamlı şekilde farklı olup olmadığı test edilmiştir.

set.seed(123)

veri <- data.frame(
  stres = rnorm(30, mean = 48, sd = 5)
)

t.test(veri$stres, mu = 50)
## 
##  One Sample t-test
## 
## data:  veri$stres
## t = -2.4962, df = 29, p-value = 0.01849
## alternative hypothesis: true mean is not equal to 50
## 95 percent confidence interval:
##  45.93287 49.59610
## sample estimates:
## mean of x 
##  47.76448
head(veri)
##      stres
## 1 45.19762
## 2 46.84911
## 3 55.79354
## 4 48.35254
## 5 48.64644
## 6 56.57532

Normallik Varsayımı

set.seed(123)

veri <- data.frame(
  stres = rnorm(30, mean = 48, sd = 5)
)

head(veri)
##      stres
## 1 45.19762
## 2 46.84911
## 3 55.79354
## 4 48.35254
## 5 48.64644
## 6 56.57532
# Normallik testi
shapiro.test(veri$stres)
## 
##  Shapiro-Wilk normality test
## 
## data:  veri$stres
## W = 0.97894, p-value = 0.7966
# QQ plot
qqnorm(veri$stres)
qqline(veri$stres, col = "red")

# Tek örneklem t testi
t.test(veri$stres, mu = 50)
## 
##  One Sample t-test
## 
## data:  veri$stres
## t = -2.4962, df = 29, p-value = 0.01849
## alternative hypothesis: true mean is not equal to 50
## 95 percent confidence interval:
##  45.93287 49.59610
## sample estimates:
## mean of x 
##  47.76448

Bu çalışmada bir grubun ortalama stres düzeyinin 50’ye eşit olup olmadığı tek örneklem t testi ile incelenmiştir. Araştırmanın hipotezleri şu şekilde kurulmuştur: H0 hipotezi grubun ortalama stres düzeyinin 50’ye eşit olduğunu (H0: μ = 50), H1 hipotezi ise grubun ortalama stres düzeyinin 50’den farklı olduğunu (H1: μ ≠ 50) ifade etmektedir. Analizde 30 gözlemden oluşan ve normal dağılımdan üretilmiş stres puanları kullanılmıştır. Öncelikle normallik varsayımı Shapiro-Wilk testi ve QQ plot ile kontrol edilmiştir. Normallik varsayımının sağlanması durumunda tek örneklem t testi uygulanmıştır. Elde edilen sonuçlar p değeri üzerinden değerlendirilmiş ve 0.05 anlamlılık düzeyi dikkate alınarak yorumlanmıştır.