Answer To: 未命名 2 SIMULATION STUDY Problem 1 People are notoriously bad at generating random numbers in their...
Mohd answered on Sep 13 2021
---
title: "Cholestrol Data Analysis"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
importing data
```{r}
library(readr)
cholesterol_j42j44cx <- read_csv("cholesterol-j42j44cx.csv")
View(cholesterol_j42j44cx)
chl<-cholesterol_j42j44cx
```
load packages
```{r}
library(readr)
library(magrittr)
library(dplyr)
```
Descriptive measures
```{r}
summary(chl)
```
Visualizing Raw data for outlier detection and distribution
There are no outliars in terms of extreme values. Both variables are normally distributed.
```{r}
boxplot(chl$Before,horizontal = TRUE)
boxplot(chl$After,horizontal = TRUE)
hist(chl$Before)
hist(chl$After)
```
separating placebo and drug data
```{r}
placebo <- chl[1:20,1:3]
dim(placebo)
drug<-chl[21:40,1:3]
dim(drug)
```
Visualize
```{r}
par(mfrow=c(2,2))
plot(placebo$Before,
placebo$cnt ,type = 'l',
col= 'red', lwd = 2,
ylab = 'triglyceride levels in mg/dL',
xlab = 'placeo before')
plot(drug$Before, drug$cnt ,type = 'l',
col= 'red', lwd = 2,
ylab = 'triglyceride levels in mg/dL',
xlab = 'beforedrug')
plot(placebo$After, placebo$cnt ,type = 'l',
col= 'red',
main = "",
lwd = 2,
ylab = 'triglyceride levels in mg/dL',
xlab = 'place after')
plot(drug$After, drug$cnt ,type = 'l',
col= 'red', lwd = 2,
ylab = 'triglyceride levels in mg/dL',
xlab = 'Afterdrug')
```
secod
```{r}
par(mfrow=c(2,2))
plot(placebo$Before,
placebo$cnt ,type = 'b',
col= 'red', lwd = 2,
ylab = 'triglyceride levels in mg/dL',
main = 'placebo_before')
plot(drug$Before, drug$cnt ,type = 'b',
col= 'red', lwd = 2,
ylab = 'triglyceride levels in mg/dL',
main = 'before_drug')
plot(placebo$After, placebo$cnt ,type = 'b',
col= 'red',
lwd = 2,
ylab = 'triglyceride levels in mg/dL',
main =...