1. 활용 데이터 sample

 

ds6.1.8-spray-painting-procedure.txt
0.00MB

출처 : 이공학도를 위한 확률과 통계 3판 8.2.19번 연습문제 - DS6.1.8

 

문제 : 평균 0.225mm의 두께로 페인트를 뿌려야할 때, 이 스프레이 페인팅 기계가 제대로 작동하고 있는지 검토하라.

 

 

 

 

 

2. 데이터 선언

 

> x <- c(0.2329999953508377, 0.28299999237060547, 0.12700000405311584, 0.2199999988079071, 0.1850000023841858, 0.28299999237060547, 0.33799999952316284, 0.17000000178813934, 0.3569999933242798, 0.2150000035762787, 0.2199999988079071, 0.18799999356269836, 0.1899999976158142, 0.2879999876022339, 0.23199999332427979, 0.13899999856948853, 0.1589999943971634, 0.2070000022649765, 0.3240000009536743, 0.15600000321865082, 0.30399999022483826, 0.21299999952316284, 0.28999999165534973, 0.2199999988079071, 0.20600000023841858, 0.1809999942779541, 0.23000000417232513, 0.1469999998807907, 0.35199999809265137, 0.13300000131130219, 0.28200000524520874, 0.20000000298023224, 0.5379999876022339, 0.3149999976158142, 0.2750000059604645, 0.3149999976158142, 0.24699999392032623, 0.16099999845027924, 0.16300000250339508, 0.23999999463558197, 0.24400000274181366, 0.2619999945163727, 0.32600000500679016, 0.15000000596046448, 0.27000001072883606, 0.2070000022649765, 0.1899999976158142, 0.1889999955892563, 0.07599999755620956, 0.29600000381469727, 0.20499999821186066, 0.2750000059604645, 0.210999995470047, 0.3269999921321869, 0.19200000166893005, 0.2460000067949295, 0.23199999332427979, 0.3109999895095825, 0.24300000071525574, 0.25099998712539673, 0.2150000035762787, 0.2849999964237213, 0.27900001406669617, 0.2800000011920929, 0.1770000010728836, 0.210999995470047, 0.18400000035762787, 0.23000000417232513, 0.15700000524520874, 0.20800000429153442, 0.15299999713897705, 0.14100000262260437, 0.24699999392032623, 0.23899999260902405, 0.1509999930858612)
> x
 [1] 0.233 0.283 0.127 0.220 0.185 0.283 0.338 0.170
 [9] 0.357 0.215 0.220 0.188 0.190 0.288 0.232 0.139
[17] 0.159 0.207 0.324 0.156 0.304 0.213 0.290 0.220
[25] 0.206 0.181 0.230 0.147 0.352 0.133 0.282 0.200
[33] 0.538 0.315 0.275 0.315 0.247 0.161 0.163 0.240
[41] 0.244 0.262 0.326 0.150 0.270 0.207 0.190 0.189
[49] 0.076 0.296 0.205 0.275 0.211 0.327 0.192 0.246
[57] 0.232 0.311 0.243 0.251 0.215 0.285 0.279 0.280
[65] 0.177 0.211 0.184 0.230 0.157 0.208 0.153 0.141
[73] 0.247 0.239 0.151

 

 

 

 

 

3. 표본 평균 구하기

 

> result.mean <- mean(x)
> print(result.mean)
[1] 0.2318133

 

 

 

 

 

4. 표본 표준편차 s 구하기

 

> result.sd <- sd(x)
> print(result.sd)
[1] 0.0701598

 

 

 

 

 

5. t 분포 기준으로 p-value 구하기

 

> xbar = result.mean
> s = result.sd
> n = 75
> mu = 0.225
> t = (xbar-mu)/(s/sqrt(n))
> t
[1] 0.8410114
> pvaluet = 2 * (1 - pt(t, n-1))
> pvaluet
[1] 0.403051

문제 : 평균 0.225mm의 두께로 페인트를 뿌려야할 때, 이 스프레이 페인팅 기계가 제대로 작동하고 있는지 검토하라. 라는 문제에 따라 풀이시, 검정통계량 t가 양수이므로 pvaluet 를 1-pt(t,n-1) 에서 2를 곱한 수치로 설정합니다.

 ( 양측 검정 )

 

 

 

 

 

6. 전체 소스

 

> x <- c(0.2329999953508377, 0.28299999237060547, 0.12700000405311584, 0.2199999988079071, 0.1850000023841858, 0.28299999237060547, 0.33799999952316284, 0.17000000178813934, 0.3569999933242798, 0.2150000035762787, 0.2199999988079071, 0.18799999356269836, 0.1899999976158142, 0.2879999876022339, 0.23199999332427979, 0.13899999856948853, 0.1589999943971634, 0.2070000022649765, 0.3240000009536743, 0.15600000321865082, 0.30399999022483826, 0.21299999952316284, 0.28999999165534973, 0.2199999988079071, 0.20600000023841858, 0.1809999942779541, 0.23000000417232513, 0.1469999998807907, 0.35199999809265137, 0.13300000131130219, 0.28200000524520874, 0.20000000298023224, 0.5379999876022339, 0.3149999976158142, 0.2750000059604645, 0.3149999976158142, 0.24699999392032623, 0.16099999845027924, 0.16300000250339508, 0.23999999463558197, 0.24400000274181366, 0.2619999945163727, 0.32600000500679016, 0.15000000596046448, 0.27000001072883606, 0.2070000022649765, 0.1899999976158142, 0.1889999955892563, 0.07599999755620956, 0.29600000381469727, 0.20499999821186066, 0.2750000059604645, 0.210999995470047, 0.3269999921321869, 0.19200000166893005, 0.2460000067949295, 0.23199999332427979, 0.3109999895095825, 0.24300000071525574, 0.25099998712539673, 0.2150000035762787, 0.2849999964237213, 0.27900001406669617, 0.2800000011920929, 0.1770000010728836, 0.210999995470047, 0.18400000035762787, 0.23000000417232513, 0.15700000524520874, 0.20800000429153442, 0.15299999713897705, 0.14100000262260437, 0.24699999392032623, 0.23899999260902405, 0.1509999930858612)
> x
 [1] 0.233 0.283 0.127 0.220 0.185 0.283 0.338 0.170
 [9] 0.357 0.215 0.220 0.188 0.190 0.288 0.232 0.139
[17] 0.159 0.207 0.324 0.156 0.304 0.213 0.290 0.220
[25] 0.206 0.181 0.230 0.147 0.352 0.133 0.282 0.200
[33] 0.538 0.315 0.275 0.315 0.247 0.161 0.163 0.240
[41] 0.244 0.262 0.326 0.150 0.270 0.207 0.190 0.189
[49] 0.076 0.296 0.205 0.275 0.211 0.327 0.192 0.246
[57] 0.232 0.311 0.243 0.251 0.215 0.285 0.279 0.280
[65] 0.177 0.211 0.184 0.230 0.157 0.208 0.153 0.141
[73] 0.247 0.239 0.151
> result.mean <- mean(x)
> print(result.mean)
[1] 0.2318133
> result.sd <- sd(x)
> print(result.sd)
[1] 0.0701598
> xbar = result.mean
> s = result.sd
> n = 75
> mu = 0.225
> t = (xbar-mu)/(s/sqrt(n))
> t
[1] 0.8410114
> pvaluet = 2 * (1 - pt(t, n-1))
> pvaluet
[1] 0.403051

 

 

+ Recent posts