Download ë¹…

Document related concepts
no text concepts found
Transcript
빅데이터 기술 개요
2016/8/20 ~ 9/3
윤형기 ([email protected])
D6
http://www.openwith.net
2
R과 기초통계
2014.2.3
윤형기
(v.0.9)
목차
•
–
–
–
–
•
•
Unit I: 개요
1.
2.
3.
4.
–
–
–
–
기본개념
Chart와 그래프
기술통계
확률
Unit II: 변량별 데이터 분석
– 5. 단변량
– 6. 이변량
– 7. 다변량
•
Unit IV: 모수 추정
•
– 8. 이산 분포
– 9. 연속 분포
– 10. 표본추출과 표본분포
신뢰구간추정(단일 모집단)
가설검정 (단일 모집단)
추정 (2개 모집단)
분산분석과 실험계획
Unit V: 비모수 추정
– 15. 범주형 데이터
– 16. 비모수 통계 *
•
Unit III: 분포와 표본추출
11.
12.
13.
14.
Unit VI: 회귀분석과 예측
– 17. 단순회귀분석
– 18. 다중회귀분석
R과 기초통계(www.openwith.net)
4
UNIT I: 개요
1.
2.
3.
4.
기본개념
Chart와 그래프
기술통계
확률
R과 기초통계(www.openwith.net)
5
1. 기본개념
• 1.1 통계 개념
R과 기초통계(www.openwith.net)
6
• 1.2 데이터의 측도 (Levels of data measurement)
R과 기초통계(www.openwith.net)
7
2. Chart와 그래프
• 2.1 Frequency Distributions
– Class Midpoint
– Relative Frequency
– Cumulative Frequency
• 2.2 계량데이터의 그래프 표현
–
–
–
–
–
Histograms
Frequency Polygons, Ogives
Pie Charts
Stem-and-Leaf Plots
Pareto Charts
• 2.3 이변량 데이터의 그래프 표현: Numerical Data
– Scatter Plots
•  Unit II: 변량별 데이터 분석 참조
R과 기초통계(www.openwith.net)
8
3. 기술통계
• 3.1 Central Tendency: Ungrouped Data
– Mode, Median, Mean
• Mode  Bimodal, Multimodal
• Median
• Mean
– Percentiles, Quartiles
• Percentiles
• Quartiles
R과 기초통계(www.openwith.net)
9
• 3.2 Variability: Ungrouped Data
–
–
–
–
Range & IQR (Interquartile Range)
MAD (Mean Absolute Deviation)
Variance
Standard Deviation
• Empirical Rule와 Chebychev’s Theorem
• Population vs. Sample Variance and Standard Deviation
– Unbiased estimator
• Z-score
• Coefficient of Variation (CV)
R과 기초통계(www.openwith.net)
10
• Z score
R과 기초통계(www.openwith.net)
11
• 3.3 Central Tendency와 변동성: Grouped Data
– Central Tendency의 측정 지표
• Mean
• Mode
– 변동성 측정지표
R과 기초통계(www.openwith.net)
12
• 3.4 Measures of Shape
– Skewness
• Coefficient of Skewness
– Kurtosis
– Box-and-Whisker Plots
R과 기초통계(www.openwith.net)
13
• 3.5 연관성 (Association) 측도
– Correlation
• Pearson product-moment correlation coefficient
• Spearman Correlation Coefficient
• Kendall Tau-b Correlation Coefficient
R과 기초통계(www.openwith.net)
14
R과 기초통계(www.openwith.net)
15
4. 확률
• 4.1 기본개념
– Experiment, (Elementary) Events, Sample Space, Independent
Events, Unions, Intersections,
– MECE (Mutually Exclusive Collectively Exhaustive)
P(X⋂Y) = 0
– Marginal, Union, Joint
– Counting Possibilities
• mn Counting Rule: m x n
• Sampling from a Population with Replacement: (N)n possibilities
• Combinations: Sampling from Population Without Replacement:
= 𝑁!/𝑛!(𝑁−𝑛)!
R과 기초통계(www.openwith.net)
NCn
16
• 4.2 Addition 및 Multiplication Laws
– Addition
• General Law of Addition:
– P(X ∪ Y) = P(X) + P(Y) - P(X ⋂ Y)
• Special Law of Addition
– If X, Y are mutually exclusive, P(X ∪ Y) = P(X) + P(Y)
– Multiplication
• General Law of Multiplication
– P(X ⋂ Y) = P(X) • P(Y|X) = P(Y) • P(X|Y)
• Special Law of Multiplication
– If X, Y are independent, P(X ⋂ Y) = P(X) • P(Y)
R과 기초통계(www.openwith.net)
17
R과 기초통계(www.openwith.net)
18
UNIT II: 변량별 데이터 분석
5. 단변량
6. 이변량
7. 다변량
R과 기초통계(www.openwith.net)
19
5. 단변량 데이터
• 5.1 Categorical Data
–
–
–
–
–
Table
Barplots
Pie Chart
Dot Chart
Factor
• 5.2 Numeric Data
– Stem-and-leaf plots
– Strip chart
– The Center: mean, median & mode
• Range, variance, …
• 5.3 분포의 모양
– Histogram
– Mode, Symmetry and Skew
– Boxplot
R과 기초통계(www.openwith.net)
20
6. 이변량 (Bivariate) 데이터
• 6.1 Pairs of categorical variables
–
–
–
–
2-way
2-way
2-way
2-way
Table (Summarized/ Unsummarized Data)
table의 주변분포 (Marginal Distribution)
table의 조건부 분포
contingency table의 그래프 요약
• 6.2 독립표본의 비교
–
–
–
–
Side-by-side Boxplots
Density plot
Strip Chart
Quantile-Quantile plots
• 6.3 Numeric Data에서의 관계(Relationship)
– Scatter plot을 이용한 관계성 분석
– 두 변수간의 상관관계
• 6.4 단순회귀분석
R과 기초통계(www.openwith.net)
21
7. 다변량 (Multivariate) 데이터
• 7.1 다변량데이터의 요약
– 범주형 다변량데이터 요약
– 독립표본의 비교
– 관계성 비교
• 7.2 R의 다변량데이터타입: Data Frame과 List
• 7.3 다변량 데이터 모델링
– Boxplot과 다변량 모델
– Contingency Table – xtabs()
– split()과 stack()
• 7.4 Lattice 그래픽 활용
R과 기초통계(www.openwith.net)
22
UNIT II: 분포와 표본추출
8. 이산 분포
9. 연속 분포
10. 표본추출과 표본분포
R과 기초통계(www.openwith.net)
23
8. 이산 분포
• 8.1 개요
– Random variable
• = a variable that contains the outcomes of a chance experiment
• 8.2 이산분포의 모양
– Mean or Expected Value
• = long-run average of occurrences
– Variance and Standard Deviation of a Discrete Distribution
• 8.2 이항분포
– Binomial formula
– Mean and Standard deviation of a Binomial Distribution
R과 기초통계(www.openwith.net)
24
• 8.3 Poisson 분포
– 개념: Law of improbable events
• focuses only on the number of discrete occurrences over some
interval or continuum
– Poisson formula
• λ = long-run average
– Poisson Tables
• lambda determines …
– Mean & Standard Deviation of a Poisson Distribution
• The mean and expected value of a Poisson distribution is λ.
R과 기초통계(www.openwith.net)
25
• 8.4 초기하 (Hypergeometric) 분포
– 개요
• = 유한 모집단으로부터 비복원추출 시 나타나는 확률분포
– 다음 경우에 이항분포 대신 사용:
• (i) Sampling is done without replacement.
• (ii) n ≥ 5% N
R과 기초통계(www.openwith.net)
26
9. 연속 분포
• 9.1 Uniform Distribution
– 개요
– 일양분포의 확률
R과 기초통계(www.openwith.net)
27
• 9.2 정규분포
– 개요
• Gaussian distribution
• Probability Density Function of Normal Distribution
– Standardized Normal Distribution
• z score = # of s.d. that a value x is above or below the mean
• z distribution
• 9.3 이항분포 대신 정규분포의 적용 (Approximate)
– 경험법칙;
• 대략 normal curve value의 99.7%가 3 s.d. 이내
• n • p > 5 and n • q > 5
– Correcting for Continuity
• ; Converting discrete distribution into a continuous distribution.
R과 기초통계(www.openwith.net)
28
• 9.4 지수분포
– = probability distribution of times between random
occurrences
– 지수분포의 확률
• Interarrival times of random arrivals are exponentially distributed
– cf. Poisson distribution = random occurrences over some interval
R과 기초통계(www.openwith.net)
29
10. 표본추출과 표본분포
• 10.1 Sampling(표본추출) 방법
• 10.2 Sampling Distribution of 𝑥
– 중심극한정리
• 𝜇𝑥 = μ
• 𝜎𝑥 =
𝜎
𝑛
– z Formula for Sample Means
– Sampling from a Finite Population
R과 기초통계(www.openwith.net)
30
– Central Limit Theorem
R과 기초통계(www.openwith.net)
31
• 10.3 Sampling Distribution of 𝑝
– 개요
• measurable data  sample mean
• countable items  sample proportion
– Sample Proportion
– z formula for Sample Proportion for n.p >5 and n.q > 5
R과 기초통계(www.openwith.net)
32
UNIT IV: 모수 추정
11.
12.
13.
14.
신뢰구간 추정 (단일 모집단)
가설검정 (단일 모집단)
추정 (2개 모집단)
분산분석과 실험계획
R과 기초통계(www.openwith.net)
33
11. 신뢰구간 추정 (단일 모집단)
• 11.1 z 통계량 이용한 신뢰구간 추정 (단일 모집단)
Known)
(σ
– 점추정 (point estimation)
– 100(1-α)% Confidence Interval to Estimate μ: σ known]
– 유한조정계수
– Sample Size가 작은 경우
• 여태까지 주로 n ≥ 30
• n < 30 이어도 중심극한정리에 의해 z formula 적용 :
• sample size가 클 때 또는 작아도 모집단이 정규분포 (σ known)
R과 기초통계(www.openwith.net)
34
• 11.2 t 통계량 이용한 신뢰구간추정 (단일모집단) (σ
Unknown)
– 모집단이 정규분포인데 모집단 s.d 를 모르는 경우 t 분포 적용.
• 표본크기에 따라 분포가 다르다.
• t statistic 의 assumption: 모집단이 정규분포
– If population is not normal dist. or is unknown, nonparametric
techniques
• t Distribution의 특징: Robust
– t 통계량을 이용한 모집단 평균 추정에서의 신뢰구간
R과 기초통계(www.openwith.net)
35
• 11.3 모비율 추정
• 11.4 모분산 추정
– (…)
• Sample Variance
• 모분산과 표본분산의 관계: χ2 분포
R과 기초통계(www.openwith.net)
36
• 11.5 표본크기의 산정
– μ 추정 시의 표본크기
• μ 추정 시: 표본크기는 z formula를 이용
• Let E = (𝑥 - μ) = the error of estimation. Substituting E into the
preceding formula yields
• sample size 결정을 위해 n을 풀이하면:
• …
– p 추정 시의 표본크기
R과 기초통계(www.openwith.net)
37
12. 가설검정 (단일 모집단)
• 12.1 개요
– Hypotheses의 종류
– Statistical Hypotheses
• H0
Ha
– 가설검정의 절차
– Rejection and Nonrejection Regions
– Type I 및 Type II Errors
R과 기초통계(www.openwith.net)
38
• 12.2 z 통계량 이용한 모평균의 가설검정 (σ Known)
– z Test for a Single Mean
– 유한모집단의 평균에 대한 검정
– p-Value를 이용한 가설검정
• p-value = observed significance level = 관측된 유의수준 (level of
significance)
• 사전에 α가 주어지는 대신 H0가 true라는 가정하에 확률을 계산
p-value defines the smallest value of 𝛼 for which the H0 can be
rejected.
• “α 가 p보다 커야만 H0를 reject 가능”
R과 기초통계(www.openwith.net)
39
– Critical Value Method를 이용한 가설검정
• Rejecting H0 using p-values
R과 기초통계(www.openwith.net)
40
• 12.3 t 통계량 이용한 모평균 가설검정 (σ Unknown)
– (…)
• z Test of a Population Proportion
R과 기초통계(www.openwith.net)
41
• 12.4 비율에 관한 가설검정
– […]
• Using p-value
• Using the critical value method
R과 기초통계(www.openwith.net)
42
• 12.5 분산에 관한 가설검정
• Table χ2 vs. Observed χ2
• H0 can also be tested by the critical value method.
• Observed χ2 value 대신 critical χ2 value for alpha를 적용하여 s2
계산  yields critical sample variance (sc2)
R과 기초통계(www.openwith.net)
43
• 12.6 Type II Errors
– Some Observations About Type II Errors
R과 기초통계(www.openwith.net)
44
– 운영특성곡선 (OC Curve)와 Power Curves
– 표본크기의 증가가 Rejection Limit에 미치는 영향
R과 기초통계(www.openwith.net)
45
13. 추정 (2개 모집단)
• 13.1 z 통계량을 이용한 두 개 평균 차에 대한 추정/가설
검정 (σ Known)
– (…)
– CLT: “”Difference in two sample means, 𝑥1 − 𝑥2 ~ ND() for large
sample (both n1 and n2 ≥ 30) regardless of the shape of
populations”
–  z formula for the difference in two sample means
– Hypothesis Testing
– H0: μ1 – μ2 =δ
– Ha: μ1 – μ2 ≠δ
– Confidence Intervals
R과 기초통계(www.openwith.net)
46
• 13.2 두 평균 차에 대한 추정/가설검정: 독립표본이고 σ
Known
– 가설검정
– t Test를 이용한 두 모평균 차에 대한 CI 수립 및 가설검정
– Confidence Intervals
R과 기초통계(www.openwith.net)
47
• 13.3 서로 관련된 모집단에 대한 추정
– 종류
• Before-and-after study
• Matched-pair with built-in relatedness, as an experimental
control mechanism (ex) twins, siblings
– 가설검정
– 신뢰구간
R과 기초통계(www.openwith.net)
48
• 13.4 두 개 모비율에 대한 추정(p1 - p2)
– (…)
– 가설검정
– 신뢰구간
• 13.5 두 개 모분산에 대한 추정
R과 기초통계(www.openwith.net)
49
14. 분산분석과 실험계획
• 14.1 실험계획
– experimental design
• = a plan and a structure to test hypotheses in which the researcher
either controls or manipulates one or more variables.
– 독립변수 (I.V.)
• 처치변인 (treatment variable)
= a variable the experimenter controls or modifies
• 분류변인 (classification variable (=factors))
= some characteristic of the subject that was present prior to the
experiment and is not a result of manipulations or control.
• Each I.V. has 2 or more levels (= classifications =subcategories)
– 종속변수 (D.V.)
R과 기초통계(www.openwith.net)
50
• 14.2 Completely Randomized Design (One-Way
ANOVA)
– One-Way Analysis of Variance
• H0: μ1 = μ2 = μ3 = … = μk
• Ha: At least one of the means is different from the others.
R과 기초통계(www.openwith.net)
51
– F 분포표 상의 수치
– ANOVA tests are always one-tailed tests
w/ rejection region in the upper tail
– “Observed F value” vs.
“Critical value of F test” (=Table F value)
(d.f.에 의해 참조되는 값)
– Reject H0 if (observed F > critical F)
– F값 및 t값의 비교
• F = t2 for dfC = 1
R과 기초통계(www.openwith.net)
52
• 14.3 다중비교 검정
– (…)
• ANOVA는multiple group의 평균 차에 대한 가설검정에 유용
– (장점) Type I error, α, is controlled
– Tukey’s Honestly Significant Difference (HSD) Test: The Case of
Equal Sample Sizes
• = pairwise multiple comparisons
– Tukey-Kramer Procedure: The Case of Unequal Sample Sizes
R과 기초통계(www.openwith.net)
53
• 14.4 Randomized Block Design
– (…)
• CRD (I.V. = treatment var. ) + Blocking variable
– Block’g var ; to control confounding/concomitant variable
» researcher want to control but is not the treatment of interest
• CRD와 비슷하지만 also includes a blocking variable, that can be
used to control for confounding or concomitant variables.
R과 기초통계(www.openwith.net)
54
RBD
CRD
R과 기초통계(www.openwith.net)
• 14.5 Factorial Design (Two-Way ANOVA)
– Factorial Design의 장점
CRD
RBD
각 변 수 의 Effect 를
별 도 로 분 석 (one
per design).
Factorial Design
하나의 실험설계에서 두 변수를 동시에 분석.
Confounding or concomitant variable을 하나의
study에서 control 가능  Additional effects of
즉 ,
Var’s
are
the second variable are removed from the SSE.
studied in isolation
즉, there is potential for increased power over
the completely randomized design because the
additional effects of the second variable are
removed from the error sum of squares.
단 , focus on one FD with 2 treatments are similar to RBD.
treatment variable & Focus on the effects of both variables.
control
for
the (2 treatment변수 간의 interaction 분석 가능, if
blocking
effect
 multiple measurements are taken under every
Interaction 분석 가능
combination of levels of 2 treatment)
R과 기초통계(www.openwith.net)
– 2개 처치변인을 가지는 Factorial Designs
– Factorial Design에 대한 통계검정
• Row effects:
H0: Row means all are equal. Ha: At least one row is different.
• Column effects:
H0: Col. means are all equal. Ha: At least one col is different.
• Interaction effects:
H0: Interaction effects =0. Ha: Interaction effect is present.
• Each of these observed F values is compared to a table F value.
• The table F value is determined by a, dfnum, and dfdenom.
R과 기초통계(www.openwith.net)
– Interaction
R과 기초통계(www.openwith.net)
UNIT V: 비모수 추정
15. 범주형 데이터
16. 비모수 통계 *
R과 기초통계(www.openwith.net)
59
15. 범주형 데이터
• 15.1 χ2 Goodness-of-Fit Test
df 값이 작아질수록
df 값이 커질수록
skewed to the right
정규분포와 유사해진다
일양분포 가정 or expected 분포가 있을 때
관측된 것이 Poisson 분포인지 알아보는 경우
관측된 것이 normal 분포인지 알아보는 경우
자유도 적용 값
k-1
k-2
λ 추정
k-3
μ, σ 추정
– 모비율 검정 using χ2 Goodness-of-Fit Test as an Alternative
Technique to the z Test
R과 기초통계(www.openwith.net)
60
• 15.2 Contingency Analysis: χ2 Test of Independence
– (…)
• χ2 적합성 검정; …
• χ2 독립성검정: 두 변수가 독립인지 여부를 알아보기 위해 여러 범
주를 가지는 두 개 변수의 빈도를 조사
• categorical data분석에 유용  contingency analysis
R과 기초통계(www.openwith.net)
61
16. 비모수 통계 *
R과 기초통계(www.openwith.net)
62
UNIT IV: 회귀분석과 예측
17. 단순회귀분석
18. 다중회귀분석
R과 기초통계(www.openwith.net)
63
17. 단순회귀분석
• 17.1 개요
– Correlation
– 단순회귀분석
• dependent variable = the variable to be predicted (y).
• independent variable = explanatory variable = The predictor (x).
• SLR의 대상: only a straight-line relationship between 2 variables
• 17.2 Regression Line Equation의 결정
• deterministic regression model is y = β0 + β1x
• probabilistic regression model is y = β0 + β1x + ε
R과 기초통계(www.openwith.net)
64
• 17.3 잔차분석
– It is the sum of squares of these residuals that is minimized to
find the least squares line.
R과 기초통계(www.openwith.net)
65
R과 기초통계(www.openwith.net)
66
• 17.4 추정값의 표준오차
– error분석을 위해 잔차 (= 개별 point에 대한 estimation errors) 계
산 대신 standard error of the estimate 이용.
• SSE is in part a function of the number of pairs of data being used
to compute the sum, which lessens the value of SSE as a
measurement of error.
• 더 좋은 지표 = standard error of the estimate (se) is a standard
deviation of the error of the regression model.
• (정규분포 empirical rule: “68% 가 μ+ 1σ 범위, 95%가 μ+ 2σ 범위.
regression의 assumption도 for a given x, error terms ~ ND() )
• 이제 error terms ~ ND(), se 는 error의 s.d., AVG error =0 이므로
– 68% of the error values (residuals) should be within 0 ±1se
– 95% of the error values (residuals) should be within 0 ±2se.
• se provides a single measure of magnitude of errors in model.
• 또한 outlier 식별에 이용. (예: outside ±2se or ±3se)
R과 기초통계(www.openwith.net)
67
• 17.5 Coefficient of Determination
– R2 = I.V. (x)가 variability of D.V. (y)를 얼마나 설명하는가
– r2=0
– …
– r2= 1
• D.V. (y) has a variation, measured by SS of y (SSyy):
– SSyy=SSR +SSE
– If each term is divided by SSyy , the resulting equation is
• r2 is proportion of y variability explained by regression model:
– Relationship Between r and r2
• r2 = (r)2
– coeff’t of correlation & determination
R과 기초통계(www.openwith.net)
68
• 17.6 회귀모델 기울기의 가설검정 & 모델 전반의
Testing
– 기울기
• r = (r)2
• (Q) If all pairs of data points for the population were available,
would the slope of that regression line be different from zero?
– H0: β1 = 0, Ha: β1 ≠ 0 (two tailed test)
– H0: β1 = 0, Ha: β1 > 0 AND H0: β1 = 0, Ha: β1 < 0
– In each case, testing the null hypothesis involves a t test of the
slope.
R과 기초통계(www.openwith.net)
69
◊
– 모델 전반의 검정
• F test to determine the overall significance of the model.
– SLR provides only 1 predictor and 1 regression coefficient to test.
• F test for overall significance is testing the same thing as the t test
in simple regression.
– H0: β1 = 0 Ha: β1 ≠ 0
– In SLR, F = t2. Thus, for the airline cost example, the F value is
• The F value is computed directly by
•
•
•
•
Note from ANOVA table that d.f. due to regression = 1.
SLR에서의 자유도 n -k -1 = n -1 -1 = n -2.
분자의 자유도 (1) / 분모의 자유도 due to error (n -2)
In simple regression, the relationship between the critical t value to
test the slope and the critical F value of overall significance is
R과 기초통계(www.openwith.net)
70
◊
• 17.7 Estimation
– C.I. to Estimate the Conditional Mean of y: μy|x
• Because for any value of I.V., x, there can be many values of y
(D.V.), one type of C.I. is an estimate of the average value of y for
a given x. This average value of y is denoted E (yx).
– Prediction Intervals to Estimate a Single Value of y
• 2nd type of interval in regression estimation is a prediction
interval to estimate a single value of y for a given value of x.
R과 기초통계(www.openwith.net)
71
R과 기초통계(www.openwith.net)
72
18. 다중회귀분석
• 18.1 Multiple Regression Model
– (…)
• Simple regression model:y =β0 + β1x +ε
• Multiple regression model:y =β0 + β1x1 + β2x2 + …+ βkxk +ε
– MR Model with 2 Independent Variables (First Order)
• y = β0 + β1 x1 + β2 x2 +ε
• Constant & coefficients are estimated from sample information: y
=b0 +b1x1 +b2x2  response surface / response plane
R과 기초통계(www.openwith.net)
73
• 18.2 Significance Test of Regression Model &
Coefficients
– <Regression 모델의 adequacy 분석>
•
•
•
•
•
test the overall significance of the model,
study the significance tests of the regression coefficients,
compute the residuals,
examine the standard error of the estimate,
observe the coefficient of determination.
– 모델 전반의 검정
• simple regression; t test of slope of the regression line to see if ≠
0. (즉, whether I.V. contribute significantly in predicting D.V. )
– H0: β1 =0
– Ha: β1 ≠0
• multiple regression; an analogous test makes use of F statistic.
– H0: β1 = β2 = β3 =…= βk =0
– Ha: At least one of the regression coefficients is ≠ 0
R과 기초통계(www.openwith.net)
74
– Significance Tests of the Regression Coefficients
• In multiple regression, individual significance tests for each
regression coefficient using t test.
– H0: β1 =0
H0: β2 =0 …
H0: βk =0
– Ha: β1 ≠ 0
Ha: β2 ≠ 0
Ha: βk ≠ 0
– d.f. for each of individual tests of regression coefficients are n - k 1.
R과 기초통계(www.openwith.net)
75
• 18.3 Residuals, Standard Error of the Estimate, and R2
– Residuals
• = error of the regression model
• 활용: outlier 탐지, regression분석 시 assumptions 검정
– SSE and Standard Error of the Estimate
• = 추정 값의 표준오차 = 추정표준오차(표준추정오차)= 차이의 표준
오차
• = 최적선에 대한 산포도에서 점들의 분산도
• = 𝑦를 중심으로 실제 y 점수분포가 (회귀선에 의한) 어느 정도인가
표시
• SSE =Σ(y - 𝑦)2
• 회귀분석의 가정 (error terms ~ ND(0) + 경험칙 (대략 잔차의 68%
가 ±1se 범위, 95% 가 ±2se 범위)  회귀모델의 데이터 fitting정도
를 측정하는데 standard error of estimate가 유용.
R과 기초통계(www.openwith.net)
76
– Coefficient of Multiple Determination (R2)
• = the proportion of variation of the dependent variable, y,
accounted for by the independent variables
– Adjusted R2
• I.V.가 추가되면서 R2 는 증가
• But, 간혹 I.V.추가 시 모델에 추가정보를 주지 못하면서 R2 만 증가.
 R2 yield an inflated figure. 이를 감안하려는 것이 adjusted R2
(추가 정보와 변화된 degrees of freedom를 함께 검토)
R과 기초통계(www.openwith.net)
77
19. 다중 Regression 모델의 구축
R과 기초통계(www.openwith.net)
78
– Tukey’s Ladder of Transformations
R과 기초통계(www.openwith.net)
79
R과 기초통계(www.openwith.net)
80
• 19.2 Indicator (Dummy) Variables
– (예) monthly salary – age – sex
R과 기초통계(www.openwith.net)
81
• 19.3 모델 구축: 탐색 절차
– regression 모델 개발:
• (i) maximize explained proportion of the deviation of y values.
• (ii) Be as parsimonious as possible.
– Search Procedures
• All Possible Regressions (모든 가능한 조합의 회귀분석)
– If a data set contains k independent variables, all possible regressions
will determine 2k -1 different models.
• Stepwise Regression (단계적 회귀분석)
– single predictor variable 에서 시작해서 adds and deletes predictors one
step at a time, examining the fit of the model at each step until no more
significant predictors remain outside the model.
– STEP 1/2/3: …
• Forward Selection (전진선택법)
– = stepwise regression과 동일. 단, once a variable is entered into the
process, it is never dropped out.
• Backward Elimination (후진제거법)
– …
R과 기초통계(www.openwith.net)
82
• 19.4 Multicollinearity (다중공선성)
– = 2 이상 독립변수가 highly correlated. (2개: collinearity; 여러 개:
multicollinearity) - 실무에서 많이 발생.
–
–
–
–
1. It is difficult to interpret the estimates of the regression coeff’ts.
2. Inordinately small t values for regression coefficients may result.
3. S.D. of regression coefficients are overestimated.
4. The algebraic sign of estimated regression coefficients may be the
opposite of what would be expected for a particular predictor value.
– multicollinearity문제는 regression 계수를 평가하는 t값에도 영향.
• Multicollinearity can result in an overestimation of s.d. of the
regression coefficients  t values tend to be underrepresentative
when multicollinearity is present.
– (Approaches to the problem)
• examine a correlation matrix to search for possible intercorrelations
among potential predictor variables.
• Stepwise regression to prevent the problem of multicollinearity.
R과 기초통계(www.openwith.net)
83
Related documents