티스토리 뷰
INTRO
기술 통계(Descriptive Statistics)
기술 통계 구하기
data load
summary : statistics
mean(평균), median(중앙값), sd(표준편차), var(분산), quantile(백분위수), min(최솟값), max(최댓값)
test_descriptive_statistics.R
rm(list=ls())
setwd = "~/Rcoding"
## data load
data(iris)
head(iris,10)
## summary
summary(iris)
## statistics$col-name
mean(iris$Sepal.Length)
median(iris$Sepal.Length)
sd(iris$Sepal.Length)
var(iris$Sepal.Length)
quantile(iris$Sepal.Length,1/4)
max(iris$Sepal.Length)
min(iris$Sepal.Length)
출력결과
> source("~/Rcoding/test_descriptive_statistics.R", echo=TRUE)
> rm(list=ls())
> setwd = "~/Rcoding"
> ## data load
> data(iris)
> head(iris,10)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
7 4.6 3.4 1.4 0.3 setosa
8 5.0 3.4 1.5 0.2 setosa
9 4.4 2.9 1.4 0.2 setosa
10 4.9 3.1 1.5 0.1 setosa
> ## summary
> summary(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 setosa :50
1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300 versicolor:50
Median :5.800 Median :3.000 Median :4.350 Median :1.300 virginica :50
Mean :5.843 Mean :3.057 Mean :3.758 Mean :1.199
3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu.:1.800
Max. :7.900 Max. :4.400 Max. :6.900 Max. :2.500
> ## statistics$col-name
> mean(iris$Sepal.Length)
[1] 5.843333
> median(iris$Sepal.Length)
[1] 5.8
> sd(iris$Sepal.Length)
[1] 0.8280661
> var(iris$Sepal.Length)
[1] 0.6856935
> quantile(iris$Sepal.Length,1/4)
25%
5.1
> max(iris$Sepal.Length)
[1] 7.9
> min(iris$Sepal.Length)
[1] 4.3
반응형
'R' 카테고리의 다른 글
(macOS)[R] 기초 통계 분석 : 회귀 분석(Regression Analysis) - 2 (0) | 2022.04.07 |
---|---|
(macOS)[R] 기초 통계 분석 : 회귀 분석(Regression Analysis) - 1 (0) | 2022.04.05 |
(macOS)[R] 결측값 처리 / 이상치 탐색 (0) | 2022.04.04 |
(macOS)[R] data.table (0) | 2022.03.30 |
(macOS)[R] sqldf, plyr (0) | 2022.03.30 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- COVID-19
- Django
- ERP
- Model
- Python
- raspberrypi
- sublime text
- Templates
- DS18B20
- Pandas
- git
- github
- analysis
- arduino
- r
- 자가격리
- 코로나
- MacOS
- pyserial
- template
- SSH
- 라즈베리파이
- DAQ
- server
- Raspberry Pi
- 확진
- 코로나19
- vscode
- CSV
- Regression
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함