21년 3월 15일 

코드스테이츠 부트캠프 12일차

Week2 Statics


오늘의 나를 뒤돌아보며,

 


12일차

Confidence Interval

 

키워드

 

  • Confidence Interval의 의미
  • CLT의 의미

 

참고한 블로그.

kongdols-room.tistory.com/125

 

랜덤 샘플의 추출 및 선택(sample)-pandas(23)

파이썬 버전 3.7 기준 pandas 버전 0.25.1 기준  무작위 샘플 추출을 위한 sample 메서드 본 포스팅에서는 객체내의 임의의 샘플을 선정하여 추출하는 방법에 대해 다룬다.  랜덤 샘플의 추출 pandas에

kongdols-room.tistory.com

pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html

 

pandas.DataFrame.sample — pandas 1.2.3 documentation

Default ‘None’ results in equal probability weighting. If passed a Series, will align with target object on index. Index values in weights not found in sampled object will be ignored and index values in sampled object not in weights will be assigned we

pandas.pydata.org

꼭 기억하고 넘어가야 하는 것

★ 신뢰구간 구하는 방법

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from scipy.stats import t
 
# 표본의 크기
= len(sample)
# 자유도
dof = n-1
# 평균의 평균
mean = np.mean(sample)
# 표본의 표준편차
sample_std = np.std(sample, ddof = 1)
# 표준 오차
std_err = sample_std / n ** 0.5 # sample_std / sqrt(n)
 
CI = t.interval(.95, dof, loc = mean, scale = std_err) # https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html
print("95% 신뢰구간: ", CI)
cs

+ Recent posts