User Tools

Site Tools


c:ms:2023:schedule

This is an old revision of the document!


통계에 대한 기초적인 이해
가설과 가설검증

  • 가설의 종류와 그 종류에 따른 통계분석법
    • z-test
    • t-test
    • ANOVA
    • Factorial ANOVA
    • correlation
    • regression
    • multiple regression
    • factor analysis
    • . . .
  • 위를 위해서 꼭 이해해야 할 것들
    • Variance
    • Standard Deviation
    • Standard Error (Standard Deviation of Sample Means)
    • Hypothesis Testing

R Cookbook
Chapter 1 Getting Started and Getting Help
Chapter 2 Some Basics
Chapter 3 Navigating the Software
Chapter 4 Input and Output
Chapter 5 Data Structures
Chapter 6 Data Transformations
Chapter 7 Strings and Dates
Chapter 8 Probability
Chapter 9 General Statistics
Chapter 10 Graphics
Chapter 11 Linear Regression and ANOVA
Chapter 12 Useful Tricks
Chapter 13 Beyond Basic Numerics and Statistics
Chapter 14 Time Series Analysis

이전 페이지

  • Week 01: March 1 (삼일절), 6
  • Week 02: March 8, 13
  • Week 03: March 15, 20
  • Week 04: March 22, 27
  • Week 05: March 29, April 3
  • Week 06: April 5 (식목일), 10
  • Week 07: April 12, 17
  • Week 08: April 19, 24
  • Week 09: April 26, May 1
  • Week 10: May 3, 8
  • Week 11: May 10, 15
  • Week 12: May 17, 22
  • Week 13: May 24, 29
  • Week 14: May 31, June 5
  • Week 15: June 7, 12
  • Week 16: June 14, 19

Week01

Course Introduction –> syllabus

ideas and concepts

동영상 (R 관련)

Introduction to R and others

  1. Downloading and Installing R
  2. Starting R
  3. Entering Commands
  4. Exiting from R
  5. Interrupting R
  6. Viewing the Supplied Documentation
  7. Getting Help on a Function
  8. Searching the Supplied Documentation
  9. Getting Help on a Package
  10. Searching the Web for Help
  11. Finding Relevant Functions and Packages
  12. Searching the Mailing Lists
  13. Submitting Questions to the Mailing Lists

동영상 (통계관련 샘플링에 대한 설명)

기본용어
기술통계 (descriptive statistics)
추론통계 (inferential statistics)
아래의 개념은 샘플링 문서를 먼저 볼것

  • sampling methods
    • probability
    • non-probability

가설 (hypothesis)

  • 차이와 연관 (difference and association)

변인 (variables)

Assignment

Week02

Concepts and ideas

Sampling
가설
지난 동영상 리캡 및 가설에 대한 소개
가설에 대한 소개 및 설명
가설이 만들어지는 이유
가설의 예
변인의 종류와 변인측정의수준

Some basics

  1. Introduction
  2. Printing Something
  3. Setting Variables
  4. Listing Variables
  5. Deleting Variables
  6. Creating a Vector
  7. Computing Basic Statistics
  8. Creating Sequences
  9. Comparing Vectors
  10. Selecting Vector Elements
  11. Performing Vector Arithmetic
  12. Getting Operator Precedence Right
  13. Defining a Function
  14. Typing Less and Accomplishing More
  15. Avoiding Some Common Mistakes

from the previous lecture (research question and hypothesis)

Qs

가설을 만들게 된 이유에서 여러 개의 social science theory를 가지고 가설을 세워서 옳다는 결과가 나오면 법칙을 맞다고 증명하기 위해 가설을 만드는 것인지 아니면 하나의 social science theory가 맞는 지 틀리는 지 가설로 측정을 해본 다음 인정을 받기 위한 것인 지 (물론 이론이 100퍼센트 옳다고 확신할 수 없다고 하고)

Assignment

Week03

그룹핑 설명 때 쓴 자료

3주차 온라인 강의 동영상은 4주에 걸쳐서 보시기 바랍니다. 즉, 4주 중에 따로 동영상 올리지 않습니다.

—–

—–
Howell, Ch. 4 내용 중 Variance와 (분산) Standard deviation은 (표준편차는) 이후 통계 검증방법을 이해하는데 기초가 되는 중요한 내용이니 꼭 숙지하시기 바랍니다.

Concepts and ideas

Navigating software

  1. Introduction
  2. Getting and Setting the Working Directory
  3. Saving Your Workspace
  4. Viewing Your Command History
  5. Saving the Result of the Previous Command
  6. Displaying the Search Path
  7. Accessing the Functions in a Package
  8. Accessing Built-in Datasets
  9. Viewing the List of Installed Packages
  10. Installing Packages from CRAN
  11. Setting a Default CRAN Mirror
  12. Suppressing the Startup Message
  13. Running a Script
  14. Running a Batch Script
  15. Getting and Setting Environment Variables
  16. Locating the R Home Directory
  17. Customizing R

Mean
Mode
Median
Variance
Standard Deviation

+-1 sd = 68% = +-1 sd
+-2 sd = 95% = +-1.96 sd
+-3 sd = 99% (99.7%) = +-3 sd

표준점수 (unit with a standard deviation) = z score

Sampling distribution via random sampling

Central Limit Theorem

Assignment

Week04

Class Activity

Lecture materials for this week

Concepts and ideas

Input and output

  1. Introduction
  2. Entering Data from the Keyboard
  3. Printing Fewer Digits (or More Digits)
  4. Redirecting Output to a File
  5. Listing Files
  6. Dealing with “Cannot Open File” in Windows
  7. Reading Fixed-Width Records
  8. Reading Tabular Data Files
  9. Reading from CSV Files
  10. Writing to CSV Files
  11. Reading Tabular or CSV Data from the Web
  12. Reading Data from HTML Tables
  13. Reading Files with a Complex Structure
  14. Reading from MySQL Databases
  15. Saving and Transporting Objects
# +-1SD = 68% 
# +-2SD = 95% 
# +-3SD = 99% 라고 했지만 
# pnorm(2) = ? 
pnorm(2)
pnorm(2) - pnorm(-2)
pnorm(90,70,10)
pnorm(90,70,10) - pnorm(50,70,10)
pnorm(3) - pnorm(-3)
qnorm(0.975)
qnorm(0.025)
qnorm(0.995)
qnorm(0.005)
pnorm(3) - pnorm(-3)

# sa, http://commres.net/wiki/sampling_distribution_in_r?#n_4
m.ca <- 70
sd.ca <- 10
rnorm(n, m.ca, sd.ca)

set.seed(1001)
iter <- 10000
n <- 4
rnorm(n, m.ca, sd.ca)

means <- rep (NA, iter)
for(i in 1:iter){
  means[i] = mean(rnorm(n, m.ca, sd.ca))
}

# according to the prefessor
m.means.should.be <- m.ca
v.means.should.be <- sd.ca^2/n
sd.means.should.be <- sqrt(v.means.should.be)
m.means.should.be
v.means.should.be
sd.means.should.be

m.means <- mean(means)
v.means <- var(means)
m.means
v.means
sd.means <- sd(means)
sd.means


se <- sd.means.should.be
se2 <- se*2
m.means - se2
m.means + se2

s1 <- rnorm(n, m.ca, sd.ca)
mean(s1)

Assignment

Week05

Announcement Quiz 01

다음 주 수요일 (6주차 첫시간) 퀴즈 있습니다.
퀴즈 범위는

  • 5주차까지 언급된 모든 동영상
  • R 과 관련해서는 동영상 내용만 포함합니다.

문서

  • 시험문제는 4지선다 혹은 단답식 답입니다.
  • 문제는 모두 50문제 정도입니다.

동영상 시청

Concepts and ideas

Data Structures

  1. Introduction
  2. Appending Data to a Vector
  3. Inserting Data into a Vector
  4. Understanding the Recycling Rule
  5. Creating a Factor (Categorical Variable)
  6. Combining Multiple Vectors into One Vector and a Factor
  7. Creating a List
  8. Selecting List Elements by Position
  9. Selecting List Elements by Name
  10. Building a Name/Value Association List
  11. Removing an Element from a List
  12. Flatten a List into a Vector
  13. Removing NULL Elements from a List
  14. Removing List Elements Using a Condition
  15. Initializing a Matrix
  16. Performing Matrix Operations
  17. Giving Descriptive Names to the Rows and Columns of a Matrix
  18. Selecting One Row or Column from a Matrix
  19. Initializing a Data Frame from Column Data
  20. Initializing a Data Frame from Row Data
  21. Appending Rows to a Data Frame
  22. Preallocating a Data Frame
  23. Selecting Data Frame Columns by Position
  24. Selecting Data Frame Columns by Name
  25. Selecting Rows and Columns More Easily
  26. Changing the Names of Data Frame Columns
  27. Editing a Data Frame
  28. Removing NAs from a Data Frame
  29. Excluding Columns by Name
  30. Combining Two Data Frames
  31. Merging Data Frames by Common Column
  32. Accessing Data Frame Contents More Easily
  33. Converting One Atomic Value into Another
  34. Converting One Structured Data Type into Another

20230329-102748.jpeg
아래 두번째 그림은 population의 평균이 102 일 때
400명을 (1600명이 아니라) 샘플로 취했을 때의
샘플평균들의 집합을 그린것입니다.
20230329-102811.jpeg

#####
mu.pop <- 100
sd.pop <- 10

set.seed(101)
treated.group <- rnorm(16, 112, 10)
treated.group
m.tg <- mean(treated.group)
m.tg

# install.packages("BSDA")
# library(BSDA)
z.test(treated.group, mu=mu.pop, sigma.x=sd.pop) 

mu.pop <- 100
sd.pop <- 10

set.seed(100)
treated.group.2 <- rnorm(16, 102, 10)
treated.group.2
m.treated.group.2 <- mean(treated.group.2)
m.treated.group.2

# install.packages("BSDA")
# library(BSDA)
z.test(treated.group.2, mu=mu.pop, sigma.x=sd.pop) 

set.seed(100)
treated.group.2 <- rnorm(1600, 102, 10)
treated.group.2
m.treated.group.2 <- mean(treated.group.2)
m.treated.group.2

# install.packages("BSDA")
# library(BSDA)
z.test(treated.group.2, mu=mu.pop, sigma.x=sd.pop) 

Assignment

Week06

Concepts and ideas

이번 주 동영상

또한 R에서 데이터를 (테이블 혹은 어레이) 이용하여 function을 적용하는 것에 대해서 잘 익혀두시기 바랍니다. 이는 R cookbook의 아래 내용에 해당이 됩니다 (특히 sapply, tapply, by 등)

Data Transformations

  1. Introduction
  2. Splitting a Vector into Groups
  3. Applying a Function to Each List Element
  4. Applying a Function to Every Row
  5. Applying a Function to Every Column
  6. Applying a Function to Groups of Data
  7. Applying a Function to Groups of Rows
  8. Applying a Function to Parallel Vectors or Lists

Strings and Dates

week06 t-test and anova note

Announcement

Assignment

Week07

Concepts and ideas

Hypothesis testing
z-test

  • r 에서 qnorm(proportion) pnorm(z-score) function 이해 필요
  • z_score 참조

types of error

7주차 동영상

Probability calculation in R ← Probability in R cookbook (텍스트북)

Probability

  1. Introduction
  2. Counting the Number of Combinations
  3. Generating Combinations
  4. Generating Random Numbers
  5. Generating Reproducible Random Numbers
  6. Generating a Random Sample
  7. Generating Random Sequences
  8. Randomly Permuting a Vector
  9. Calculating Probabilities for Discrete Distributions
  10. Calculating Probabilities for Continuous Distributions
  11. Converting Probabilities to Quantiles
  12. Plotting a Density Function

w07 anova note

Assignment


8주차 퀴즈

8주차 정기시험기간 중에 2차 퀴즈

Week08

시험기간
보강영상 수업

Week09

Concepts and ideas

영상 ANOVA

위키페이지 참조

General Statistics

  1. Introduction
  2. Summarizing Your Data
  3. Calculating Relative Frequencies
  4. Tabulating Factors and Creating Contingency Tables
  5. Testing Categorical Variables for Independence
  6. Calculating Quantiles (and Quartiles) of a Dataset
  7. Inverting a Quantile
  8. Converting Data to Z-Scores
  9. Testing the Mean of a Sample (t Test)
  10. Forming a Confidence Interval for a Mean
  11. Forming a Confidence Interval for a Median
  12. Testing a Sample Proportion
  13. Forming a Confidence Interval for a Proportion
  14. Testing for Normality
  15. Testing for Runs
  16. Comparing the Means of Two Samples
  17. Comparing the Locations of Two Samples Nonparametrically
  18. Testing a Correlation for Significance
  19. Testing Groups for Equal Proportions
  20. Performing Pairwise Comparisons Between Group Means
  21. Testing Two Samples for the Same Distribution

vene . . . go or come

intervene

  • intervenient

convene

  • convention
  • convent
  • convenient

contravene
prevent
advent
circumvent

Assignment

그룹 assignment week09
cookies.xlsx –> 2-way ANOVA test 계산해보기
repeated_measures_anova_eg.xlsx –> Repeated measure ANOVA 계산해보기 (Repeated Measure ANOVA 참조).
과제 첫 번째 문제는 Repeated measure ANOVA 입니다. Factorial ANOVA가 아닙니다.

patient	drug1	drung2	drug3
1	30	28	16
2	14	18	10
3	24	20	18
4	38	34	20
5	26	28	14

edited
ms.23.ga.w09.anova

  1. 위 데이터를 엑셀과 같은 스프레드시트 프로그램에 입력하고 F-test를 직접 계산하세요.
    • detergent.anova.by.hand.xlsx 엑셀의 데이터를 가지고 F-test를 직접 계산하세요.
    • 과제는 ms.23.ga.groupID.w09.anova.by.hand.xlsx 파일에 두개의 tab을 만들어 수행하고 제출하세요
    • 위 파일을 다운로드 받아서 anova test를 직접 계산하세요.
    • 계산한 결과를 ms.23.ga.groupID.w09.twoway.anova.by.hand.xlsx 파일이름으로 저장하여 업로드하세요.
  2. twoway.anova.by.hand.data.csv 파일을 R에서 데이터로 (df) 불러와서 F-test를 수행하세요. 수행한 내용을 캡춰하여 groupID.w.09.twoway.anova.by.hand.data.docx 에 저장하여 업로드하세요. 과제 작성은 fixed font로 해야 합니다.
  3. 조원과 의논하여 아래를 수행하세요
    • Indepdent sample t-test 를 수행할 가설을 전공과 관련하여 만드세요.
    • Oneway ANOVA 를 수행할 가설을 전공과 관련하여 만드세요.
    • Repeated measure ANOVA 를 수행할 가설을 전공과 관련하여 만드세요.
    • Twoway ANOVA 를 수행할 가설을 전공과 관련하여 만드세요.
    • ms.23.ga.groupID.w09.making.hypothesis.odc 와 같은 파일 이름으로 저장하여 업로드하세요

—-

소희학생 과제

  • 아래를 수행하세요. 소희학생은 group 13으로 되어 있어서 group 13으로 올리시기 바랍니다.
  • 아래를 수행하세요
    • R에서 ?ToothGrowth 를 친 후에 이 데이터가 무엇에 관한 것인지 설명하세요.
    • supp를 독립변인으로 하여 가설을 만들고, R에서 검증한 후 (t-test) 결과를 출력하고 (출력은 fixed font로 해야 합니다), 이를 해석하세요.
    • dose를 독립변인으로 하여 가설을 만들고, R에서 검증을 한 후에 결과를 출력하고, 이를 해석하세요.
    • supp와 dose를 동시에 독립변인으로 하여 R에서 검증을 한 후에 결과를 출력하고, 이를 해석하세요.
  • 과제는 ms.23.ga.w09.anova.by.hand 의 과제제출란에 제출하되,
  • 파일이름은 ga.g13.w09.hypothesis.testing.docx 로 하여 과제파일을 올리세요.

Week10

Concepts and ideas

10주차 동영상입니다.

see w10.lecture.note

Assignment

Week11

Concepts and ideas

동영상 (총 5 개)

—-

w11.lecture.note

repeated measure ANOVA
correlation


regression
multiple regression
using dummy variables

getting started
basics
navigating in r
input output in r
data structures
data transformations


Graphics

  1. Introduction
  2. Creating a Scatter Plot
  3. Adding a Title and Labels
  4. Adding a Grid
  5. Creating a Scatter Plot of Multiple Groups
  6. Adding a Legend
  7. Plotting the Regression Line of a Scatter Plot
  8. Plotting All Variables Against All Other Variables
  9. Creating One Scatter Plot for Each Factor Level
  10. Creating a Bar Chart
  11. Adding Confidence Intervals to a Bar Chart
  12. Coloring a Bar Chart
  13. Plotting a Line from x and y Points
  14. Changing the Type, Width, or Color of a Line
  15. Plotting Multiple Datasets
  16. Adding Vertical or Horizontal Lines
  17. Creating a Box Plot
  18. Creating One Box Plot for Each Factor Level
  19. Creating a Histogram
  20. Adding a Density Estimate to a Histogram
  21. Creating a Discrete Histogram
  22. Creating a Normal Quantile-Quantile (Q-Q) Plot
  23. Creating Other Quantile-Quantile Plots
  24. Plotting a Variable in Multiple Colors
  25. Graphing a Function
  26. Pausing Between Plots
  27. Displaying Several Figures on One Page
  28. Opening Additional Graphics Windows
  29. Writing Your Plot to a File
  30. Changing Graphical Parameters

Assignment

과제명: ms23.w11.ga.covariance.exercise
제출파일명: ms23.w11.ga.covariance.exercise.group##.odc (docx)
과제내용:
아래 데이터를 다운로드 받아서 두 변인 간의 상관관계계수를 구하시오.
income.happiness.csv
데이터는 수입과 행복을 측정한 것입니다. 실제 데이터를 살펴보고 R로 읽어 온 후에 R을 이용하여 아래를 구하시오. R에서의 명령어와 아웃풋을 카피/패이스트 하여 제출하시오 (fixed-font를 사용하여).

  • 각 변인의 deviation score 값을 구하여 ds.inc 와 ds.hap 에 저장하시오.
  • 두 변인의 SP값을 (Sum of Product) 구하여 sp.dat 에 저장하시오.
  • 두 변인의 df값을 구하여 df.dat 에 저장하시오.
  • 두 변인간 covariance값을 r의 cov 명령어를 이용하여 구하여 cov.dat값에 저장하시오.
  • sp.dat / df.dat 값을 구하여 cov.cal 값에 저장하시오.
  • cov.cal 과 cov.dat 값이 같은지 비교하시오. (힌트: == 연산자를 이용하여 확인하시오)
  • 각 변인의 standard deviation 값을 구하여 sd.inc, sd.hap에 저장하시오
  • 우리가 배운 correlation값을 구하는 공식에 따라서 r 값을 구해서 r.cal 에 저장하시오.
  • R의 cor 명령어를 이용하여 correlation coefficient값을 구하여 r.dat 에 저장하시오.
  • r.cal 과 r.dat 을 비교하시오.

Week12

May 22 (월), 24 (수)
w12.lecture.note

Announcement

Concepts and ideas

동영상 Regression

  1. https://youtu.be/68gho4ubOjs : Regression 1. Intro
  2. https://youtu.be/qXSRgSh1rw0 : Regression 2. e.g. 1
  3. https://youtu.be/I8wt2W7-Iio : Regression 3. e.g. 2

chi-square test
probability
general statistics

Graphics

Assignment

Week13

May 29 (월), 31 (수)
May 31 (수)
6월 5일 (월) 세번째 퀴즈
퀴즈 범위는
처음부터 multiple regression까지

퀴즈 범위는
stats part

r part

r은 주로 아웃풋에 대한 질문이 있을 예정입니다. 오픈 북이니 모든 명령어 등을 외울 필요는 없습니다.

Concepts and ideas

영상

Assignment

Week14

Week15

June 12, 14

Assignment

그룹 assignment: ms.23.ga.w15.multiple.regression.groupID
그룹의 아래의 두 개 중 하나를 택하여 수행하시오. 6월 19일까지 완성 (ABB)

    • data: elemapi2.csv
    • api00 을 종속변인으로 하고 관련이 있을 것 같고 흥미로운 변인들을 독립변인으로 하여 (최소한 3개 이상, 그 중 하나는 종류변인이어야 합니다) multiple regression을 디자인 하고 이를 수행한 후 경과와 결과를 보고하시오
    • api00을 종속변인으로 하고 두 개의 독립변인으로 avg_ed와 mealcat 두 개를 골라서 interaction을 포함한 regression을 수행한 후 경과와 결과를 보고하시오.
    • data: College (in ISLR package in R)
      • data에 대한 정보
      • library(ISLR)?College
    • 종속변인 하나를 골라서 다른 독립변인들을(최소 3개 이상) 가지고 Regression을 수행한 후 경과와 결과를 보고하시오.
    • 위에서의 종속변인과 두개의 독립변인을 골라서 (숫자+숫자 혹은 숫자+종류) interaction 효과를 포함하는 Regression을 한 후에 경과와 결과를 보고하시오

Week16

June 19, 21 (퀴즈일자에만 퀴즈를 보고 수업은 없음)

Final-term

c/ms/2023/schedule.1686699444.txt.gz · Last modified: 2023/06/14 08:37 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki