Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

How to create a Student's t Q-Q plot in R using ggplot2? | StatswithR | Arnab Hazra

Автор: StatswithR

Загружено: 2020-08-13

Просмотров: 1873

Описание:

Here we explain how to generate a presentation/publication-quality Student's t Q-Q plot in R/R-studio using ggplot2. The codes for the steps explained in the video are as follows. Copy and paste them into R, run them one-by-one and try to understand what each argument is doing.

#datascience #datavisualization #visualization #ggplot2 #tidyverse #qqplot #rstudio #rcoding #studentt

Step 0a: If you don't know how to load data into R, simulate a vector X using

X = 175 + 10 * rt(1e4, df = 10)

Step 0b: if you have not installed the packages fitdistrplus, metRology, ggplot2 and qqplotr, run

install.packages("fitdistrplus"); library(fitdistrplus)
install.packages("metRology"); library(metRology)
install.packages("ggplot2"); library(ggplot2)
install.packages("qqplotr"); library(qqplotr)

Step 0c: Estimate the parameters using

par.est = fitdist(X, distr = "t.scaled", start = list(mean = mean(X), sd = sd(X), df = 30))

Step 1: ggplot(mapping = aes(sample = X)) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2)

Step 2: ggplot(mapping = aes(sample = X)) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + xlab("Theoretical Quantiles") + ylab("Sample Quantiles")

Step 3: ggplot(mapping = aes(sample = X)) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + stat_qq_line(distribution = "t.scaled", dparams = par.est$estimate) +
xlab("Theoretical Quantiles") + ylab("Sample Quantiles")

Step 4: ggplot(mapping = aes(sample = X)) +
stat_qq_band(distribution = "t.scaled", dparams = par.est$estimate) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + stat_qq_line(distribution = "t.scaled", dparams = par.est$estimate) +
xlab("Theoretical Quantiles") + ylab("Sample Quantiles")

Step 5: ggplot(mapping = aes(sample = X)) +
stat_qq_band(distribution = "t.scaled", dparams = par.est$estimate) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + stat_qq_line(distribution = "t.scaled", dparams = par.est$estimate) +
xlab("Theoretical Quantiles") + ylab("Sample Quantiles") +
ggtitle("Student's t Q-Q plot of heights")

Step 6: ggplot(mapping = aes(sample = X)) +
stat_qq_band(distribution = "t.scaled", dparams = par.est$estimate) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + stat_qq_line(distribution = "t.scaled", dparams = par.est$estimate) +
xlab("Theoretical Quantiles") + ylab("Sample Quantiles") +
ggtitle("Student's t Q-Q plot of heights") +
theme(plot.title = element_text(hjust = 0.5))

Step 7: ggplot(mapping = aes(sample = X)) +
stat_qq_band(distribution = "t.scaled", dparams = par.est$estimate) +
stat_qq_point(distribution = "t.scaled", dparams = par.est$estimate, size = 2) + stat_qq_line(distribution = "t.scaled", dparams = par.est$estimate) +
xlab("Theoretical Quantiles") + ylab("Sample Quantiles") +
ggtitle("Student's t Q-Q plot of heights") +
theme(plot.title = element_text(hjust = 0.5)) +
theme(axis.text=element_text(size=20),
axis.title=element_text(size=20),
plot.title = element_text(size=20))

How to create a Student's t Q-Q plot in R using ggplot2? | StatswithR | Arnab Hazra

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

array(10) { [0]=> object(stdClass)#5084 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "zzUfWDKDjHE" ["related_video_title"]=> string(78) "How to create a normal Q-Q plot in R using ggplot2? | StatswithR | Arnab Hazra" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(10) "StatswithR" } [1]=> object(stdClass)#5057 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "JtYhsnOXWCw" ["related_video_title"]=> string(96) "How to create a nice bar chart in R using ggplot2? | Top 10 economies | StatswithR | Arnab Hazra" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(10) "StatswithR" } [2]=> object(stdClass)#5082 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "qMIqXuoDSGg" ["related_video_title"]=> string(82) "Step-by-Step Guide: How to Use EXIM Data Analytics Tool for Export-Import Business" ["posted_time"]=> string(19) "1 час назад" ["channelName"]=> string(10) "EXIM Elite" } [3]=> object(stdClass)#5089 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "AVJmjg4AgFY" ["related_video_title"]=> string(83) "Is my data Normally Distributed? Probably not! Statistics, qqplots, and Histograms." ["posted_time"]=> string(21) "3 года назад" ["channelName"]=> string(13) "BurkeyAcademy" } [4]=> object(stdClass)#5068 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "tX8RaTp7jL8" ["related_video_title"]=> string(92) "How to get terrain data and draw spatial maps in R using ggplot2? | StatswithR | Arnab Hazra" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(10) "StatswithR" } [5]=> object(stdClass)#5086 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "uUrpicDpiWs" ["related_video_title"]=> string(100) "Покушение на Зеленского / Предатель в Офисе президента" ["posted_time"]=> string(24) "15 часов назад" ["channelName"]=> string(10) "NEXTA Live" } [6]=> object(stdClass)#5081 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "oFUbYMFqSP8" ["related_video_title"]=> string(86) "How to draw multiple functions together in R using ggplot2? | StatswithR | Arnab Hazra" ["posted_time"]=> string(21) "4 года назад" ["channelName"]=> string(10) "StatswithR" } [7]=> object(stdClass)#5091 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "52yhBkkulXw" ["related_video_title"]=> string(30) "Математик и черт" ["posted_time"]=> string(20) "13 лет назад" ["channelName"]=> string(8) "SerCtrlX" } [8]=> object(stdClass)#5067 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "i-FFVM4cIXQ" ["related_video_title"]=> string(138) "База по Базам Данных - Storage (Индексы, Paging, LSM, B+-Tree, R-Tree) | Влад Тен Систем Дизайн" ["posted_time"]=> string(22) "10 дней назад" ["channelName"]=> string(15) "Влад Тен" } [9]=> object(stdClass)#5085 (5) { ["video_id"]=> int(9999999) ["related_video_id"]=> string(11) "l7ef_ApvFmg" ["related_video_title"]=> string(176) "ПЕРЕМИРИЕ ЗАКОНЧИЛОСЬ! Весь Тель-Авив в огне. Массированные удары ИРАНА. План Трампа провалился." ["posted_time"]=> string(23) "9 часов назад" ["channelName"]=> string(17) "Мир Добра" } }
How to create a normal Q-Q plot in R using ggplot2? | StatswithR | Arnab Hazra

How to create a normal Q-Q plot in R using ggplot2? | StatswithR | Arnab Hazra

How to create a nice bar chart in R using ggplot2? | Top 10 economies | StatswithR | Arnab Hazra

How to create a nice bar chart in R using ggplot2? | Top 10 economies | StatswithR | Arnab Hazra

Step-by-Step Guide: How to Use EXIM Data Analytics Tool for Export-Import Business

Step-by-Step Guide: How to Use EXIM Data Analytics Tool for Export-Import Business

Is my data Normally Distributed? Probably not! Statistics, qqplots, and Histograms.

Is my data Normally Distributed? Probably not! Statistics, qqplots, and Histograms.

How to get terrain data and draw spatial maps in R using ggplot2? | StatswithR | Arnab Hazra

How to get terrain data and draw spatial maps in R using ggplot2? | StatswithR | Arnab Hazra

Покушение на Зеленского / Предатель в Офисе президента

Покушение на Зеленского / Предатель в Офисе президента

How to draw multiple functions together in R using ggplot2? | StatswithR | Arnab Hazra

How to draw multiple functions together in R using ggplot2? | StatswithR | Arnab Hazra

Математик и черт

Математик и черт

База по Базам Данных - Storage (Индексы, Paging, LSM, B+-Tree, R-Tree) | Влад Тен Систем Дизайн

База по Базам Данных - Storage (Индексы, Paging, LSM, B+-Tree, R-Tree) | Влад Тен Систем Дизайн

ПЕРЕМИРИЕ ЗАКОНЧИЛОСЬ! Весь Тель-Авив в огне. Массированные удары ИРАНА. План Трампа провалился.

ПЕРЕМИРИЕ ЗАКОНЧИЛОСЬ! Весь Тель-Авив в огне. Массированные удары ИРАНА. План Трампа провалился.

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]