Original Data

Column

A look at the data

                            Stratified by genotype
                             Delta          WT             p      test
  n                              11              8                    
  sex = M (%)                     6 (54.5)       5 (62.5)   1.000     
  body_weight (mean (SD))     38.10 (8.26)   39.10 (11.04)  0.823     
  body_length (mean (SD))     10.61 (0.38)   10.65 (0.64)   0.864     
  heart_weight (mean (SD))   209.55 (30.00) 206.62 (54.31)  0.882     
  tibia_average (mean (SD))   19.04 (0.71)   19.30 (0.69)   0.432     
  HT_Body_Wt (mean (SD))       5.69 (1.19)    5.55 (1.68)   0.831     
  HT_Body_Length (mean (SD))  19.74 (2.63)   19.33 (4.73)   0.814     
  HT_Tibia (mean (SD))        11.02 (1.64)   10.74 (2.97)   0.794     
                            Stratified by sex
                             F              M              p      test
  n                               8             11                    
  genotype = WT (%)               3 (37.5)       5 (45.5)   1.000     
  body_weight (mean (SD))     39.00 (8.80)   38.17 (9.98)   0.855     
  body_length (mean (SD))     10.44 (0.32)   10.76 (0.56)   0.158     
  heart_weight (mean (SD))   192.38 (23.87) 219.91 (47.10)  0.149     
  tibia_average (mean (SD))   19.28 (0.78)   19.05 (0.64)   0.481     
  HT_Body_Wt (mean (SD))       5.13 (1.13)    5.99 (1.47)   0.182     
  HT_Body_Length (mean (SD))  18.43 (2.24)   20.39 (4.17)   0.245     
  HT_Tibia (mean (SD))         9.99 (1.28)   11.56 (2.56)   0.130     

Statistics

Row

Normality Tests


Heart Weight

    Shapiro-Wilk normality test

data:  casq2_weight$heart_weight
W = 0.97263, p-value = 0.8276

Body Weight

    Shapiro-Wilk normality test

data:  casq2_weight$body_weight
W = 0.92679, p-value = 0.1511

Tibia Length Average

    Shapiro-Wilk normality test

data:  casq2_weight$tibia_average
W = 0.96661, p-value = 0.7072

All variables passed normality test by being non-significant

T-test


Heart Weight between Genotype T-Test

    Welch Two Sample t-test

data:  heart_weight by genotype
t = 0.13759, df = 10.103, p-value = 0.8933
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -44.30768  50.14859
sample estimates:
mean in group Delta    mean in group WT 
           209.5455            206.6250 

Visualizations

Row

Heart Weight

Heart Weight Normalized to Body Weight

Heart Weight Normalized to Tibia Length

About

Row

Dashboard made by Jacob Noeker

---
title: "Casq2 Weight Project"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
    
---

```{r setup, include=FALSE}

library(tidyverse)
library(readxl)
library(ggplot2)
library(plotly)
library(tableone)
knitr::opts_chunk$set(message = FALSE)

```

Original Data {vertical_layout=fill data-icon="fa-archive" data-orientation=rows}
===================================== 

Column {data-width=10000}
------------------------------------------------------------------------------

### A look at the data

```{r raw data}

casq2_weight <- read_excel("DVR Mice Dissections.xlsx", 
                               sheet = "R")


#AD Look at tableone::createTableOne for some better options than `summary`

vars <- c("sex", "body_weight", "body_length", "heart_weight", "tibia_average", "HT_Body_Wt", "HT_Body_Length", "HT_Tibia")
tableOne <- CreateTableOne(vars = vars, strata = c("genotype"), data = casq2_weight)
tableOne


vars2 <- c("genotype", "body_weight", "body_length", "heart_weight", "tibia_average", "HT_Body_Wt", "HT_Body_Length", "HT_Tibia")
table2 <- CreateTableOne(vars = vars2, strata = c("sex"), data = casq2_weight)
table2
```

Statistics {vertical_layout=scroll data-icon="fa-asterisk"}
===================================== 

Row {.tabset .tabset-fade data-height=10000}
------------------------------------------------------------------------------

### Normality Tests

***
Heart Weight
```{r embryo}

shapiro.test(casq2_weight$heart_weight)



```

***
Body Weight
```{r Placenta}
shapiro.test(casq2_weight$body_weight)

```

***
Tibia Length Average
```{r EP}
shapiro.test(casq2_weight$tibia_average)

```

***

All variables passed normality test by being non-significant


### T-test

*** 
Heart Weight between Genotype T-Test
```{r ttest}

t.test(heart_weight ~ genotype, data = casq2_weight)


```



Visualizations {data-orientation=columns data-icon="fa-chart-bar"}
===================================== 
Row {.tabset data-height=400}
------------------------------------------------------------------------------

### Heart Weight

```{r interactive}

jn_theme <- function(){
  theme_bw() +
    theme(axis.text = element_text(size = 14, color = "Black"),
          axis.title = element_text(size = 16),
          panel.grid.minor = element_blank(),
          strip.text = element_text(size=14),
          strip.background = element_blank(),
          plot.title = element_text(size = 20, hjust = 0.5),
          panel.grid.major.x = element_blank())
}

heart_weight_viz <- ggplot(casq2_weight, aes(x=genotype, y=heart_weight)) + 
  geom_violin() + 
  theme_bw() + 
  geom_point(size = .5, height = 0, width = 0.05) + 
  scale_x_discrete(limits = c("WT", "Delta")) +
  stat_summary(fun.y = mean, geom="point", shape = 18, size  = 3, color = "red") + 
  stat_summary(fun.y = median,  geom = "point", shape = 3, size = 3, color = "blue")

heart_weight_viz

library(plotly)

ggplotly(heart_weight_viz, tooltip = c("heart_weight", "sex"))%>%layout(violinmode = 'group', violingap = 1, violingroupgap = 1)

```


### Heart Weight Normalized to Body Weight

```{r interactive2}

jn_theme <- function(){
  theme_bw() +
    theme(axis.text = element_text(size = 14, color = "Black"),
          axis.title = element_text(size = 16),
          panel.grid.minor = element_blank(),
          strip.text = element_text(size=14),
          strip.background = element_blank(),
          plot.title = element_text(size = 20, hjust = 0.5),
          panel.grid.major.x = element_blank())
}

heart_weight_body_weight <- ggplot(casq2_weight, aes(x=genotype, y=HT_Body_Wt)) + 
  geom_violin() + 
  theme_bw() + 
  geom_point(size = .5, height = 0, width = 0.05) + 
  scale_x_discrete(limits = c("WT", "Delta")) +
  stat_summary(fun.y = mean, geom="point", shape = 18, size  = 3, color = "red") + 
  stat_summary(fun.y = median,  geom = "point", shape = 3, size = 3, color = "blue")

heart_weight_body_weight

library(plotly)

ggplotly(heart_weight_body_weight, tooltip = c("HT_Body_Wt", "sex"))%>%layout(violinmode = 'group', violingap = 1, violingroupgap = 1)

```


### Heart Weight Normalized to Tibia Length

```{r interactive3}

jn_theme <- function(){
  theme_bw() +
    theme(axis.text = element_text(size = 14, color = "Black"),
          axis.title = element_text(size = 16),
          panel.grid.minor = element_blank(),
          strip.text = element_text(size=14),
          strip.background = element_blank(),
          plot.title = element_text(size = 20, hjust = 0.5),
          panel.grid.major.x = element_blank())
}

heart_weight_tibia_length <- ggplot(casq2_weight, aes(x=genotype, y=HT_Tibia)) + 
  geom_violin() + 
  theme_bw() + 
  geom_point(size = .5, height = 0, width = 0.05) + 
  scale_x_discrete(limits = c("WT", "Delta")) +
  stat_summary(fun.y = mean, geom="point", shape = 18, size  = 3, color = "red") + 
  stat_summary(fun.y = median,  geom = "point", shape = 3, size = 3, color = "blue")

heart_weight_tibia_length

library(plotly)

ggplotly(heart_weight_tibia_length, tooltip = c("HT_Tibia", "sex"))%>%layout(violinmode = 'group', violingap = 1, violingroupgap = 1)

```


About {data-orientation=rows data-icon="fa-comment-alt"}
===================================== 

Row {data-height=1000}
------------------------------------------------------------------------------

Dashboard made by Jacob Noeker