首页 > 其他分享 >第二个草稿

第二个草稿

时间:2024-05-30 13:33:36浏览次数:16  
标签:genotype 草稿 supp vitamin times 第二个 teeth data

1. Vitamin C and tooth growth

Lack of vitamin C leads to severe health issues. It is not produced in the human body and must be supplied with food. At the same time, personnel that have limited access to fresh vegetables (sailors, spacemen, travelers, etc) may suffer from the insufficiency of this compound in their food. Thus, a vitamin C formulation that can preserve its properties for a long time is of great need.

Researchers developed such a formulation. In vitro tests showed its efficiency. Now, they performed an in vivo trial. Guinea pigs received the newly developed formulation of Vitamin C or fresh orange juice (normalized according to the concentration of vitamin C) in addition to their standard diet (supp). Each type of additives included three concentrations (dose) of vitamin C: 0.5, 1, and 2 mg/ml. The measured outcome is the tooth length (len) in mm (stem cells that become teeth are sensitive to vitamin C).

Import, check, and organize the data appropriately. Reformat columns if needed.

library(dplyr)
teeth <- read.csv("teeth.csv")

teeth <- teeth %>% 
  mutate(dose = factor(dose, levels=c(0.5,1,2),ordered = T),
         supp = as.factor(supp)) %>%
  relocate(supp,dose)


summary(teeth) #  check the data
head(teeth)

unique(teeth$dose)
unique(teeth$supp)





Plot the data in a useful way.

library(ggplot2)

# 假设 teeth 是已经导入的数据框
p1 <- ggplot(teeth, aes(y = len, x = supp, fill = factor(dose))) +
  geom_boxplot(width = 0.5, alpha = 0.5) +  # 绘制箱型图
  geom_point(position = position_jitter(width = 0.25), alpha = 0.75, size = 0.5) +  # 绘制散点图,位置略有偏移以避免重叠
  labs(title = "Tooth Length by Supplement Type and Dose",
       x = "Supplement Type", y = "Tooth Length (mm)") +
  theme_minimal() + 
  facet_wrap(~dose)
p1

Choose, justify, state the statistical hypotheses, and carry out an appropriate test to answer whether the vitamin C formula is useful.

Use two way ANOVA
H0: Means of different supp groups are the same
H1: Means of different supp groups are NOT the same

aov_model <- aov(len ~ supp * dose, data = teeth)
# Normality of residuals 
plot(aov_model,2)
# Equality of variance 
plot(aov_model,1)

summary(aov_model)


posthoc_res <- TukeyHSD(aov_model)
posthoc_res

Present and discuss your results. Is this novel formula useful? What would you suggest doing next?

That means the formulations and their concentrations have different effects on tooth growth.
new formulation generally worth than OJ(~1.7mm,p<0.0001)

\newpage

2. Mutation and survival

You work on the mutation of a certain gene (Gene_X) that likely causes developmental abnormalities in humans but is quite rare, and the precise role of the mutation is not known. You created a mouse model by introducing a similar mutation in a similar location within the murine genome.

You set several breeding pairs and crossed mice as Gene_XWT/mut $\times$ Gene_XWT/mut. You recorded the genotype of the newborn mice. Your genotyping record (genotype.csv) includes mouse_ID, birth date (BD), sex, and genotype.

Answer the questions below, provide your analysis, and explain your results. Given the genotyping records you got, what can you say about the studied mutation?

Import and organize the data.

genotype <- read.csv("genotype.csv")
genotype <- genotype %>% mutate(genotype= as.factor(genotype), sex = as.factor(sex))
head(genotype)

anyNA(genotype)

anyDuplicated(genotype)

summary(genotype)

unique(genotype$genotype)

Describe the data in a useful way.

p2 <- ggplot(genotype,aes(x = genotype, fill = sex)) +
  geom_bar(position = "stack")
p2

What would you expect under Mendelian inheritance?

The distribution expected is 1:2:1 and female and male is 1:1.

tab_o <- table(genotype$sex, genotype$genotype)
tab_e <- matrix(c(1/4, 1/8, 1/8, 1/4, 1/8, 1/8), nrow = 2, byrow = TRUE)

tab_o
colnames(tab_e) <- c("WT","het","mut")
rownames(tab_e) <- c("Female","Male")

chi_res <- chisq.test(tab_o,p = tab_e)
chi_res



Choose and justify the appropriate statistical test, state the statistical hypotheses, and carry the test out an appropriate test on whether the mutation affects the survival of mice.

Present and discuss your results. What would you suggest doing next?

\newpage

3. Coffee shop opening hours

A new coffee shop has opened on campus. Hooray! Coffee shops are normally open from 6am-5pm but the owners are aware that students often sleep later than other members of the society. After being open for one month, they run a month-long trial opening 10am-9pm to see if students prefer these times. They leave an iPad at the serving counter where customers can record if they are 'satisfied' or 'unsatisfied' with the opening times.

During the 6am-5pm opening times, the iPad records 864 presses of the 'satisfied' button by customers and 714 presses of the 'unsatisfied' button. When they change these times to 10am-9pm, they receive 980 'satisfied' pressed and 473 'unsatisfied'.

What would be a suitable statistical test for these data and why?

early_s <- 864
early_u <- 714
late_s <- 980
late_u <- 473

early_bootstrap <- vector()
late_bootstrap <- vector()

a_res <- c(rep(1,early_s),rep(0,early_u))
b_res <- c(rep(1,early_u),rep(0,early_u))

for (i in 1:1000) {
  a_sample <- mean(sample(a_res,length(a_res),replace = T))
  b_sample <- mean(sample(b_res,length(b_res),replace = T))
  
  early_bootstrap <- c(early_bootstrap,a_sample)
  late_bootstrap <- c(late_bootstrap,b_sample)
  
}

first_upper <- quantile(early_bootstrap,probs = c(0.975))
boxplot(early_bootstrap,late_bootstrap)


What are your null and alternative hypotheses?

Are students more satisfied with the early or later opening times?

标签:genotype,草稿,supp,vitamin,times,第二个,teeth,data
From: https://www.cnblogs.com/rlrl81/p/18222166

相关文章

  • 我创建了一个文件夹/软件包,其中有两个子软件包(第一个=subpkg1,第二个=subpkg2),在subpkg1
    我正在使用VS代码学习Java。我创建了一个文件夹/包(name=pkg)然后,我在该包中创建了两个包(第一个=subpkg1,第二个=subpkg2)但我在subpkg1中创建了一个文件(test1)并从subpkg2中导入文件(name=food)然后编译并运行。我一直收到pkg.subpkg2doesn'texist的错误信息(见......
  • logo设计从创意到草稿到成品的过程(商标设计详解)
    一logo的设计过程1了解需求设计师先了解企业和产品的特点,总结提炼一些关键词2调研分析设计师需要了解客户的竞争对手,确保自己的设计的logo作品和竞争对手比有足够的辨识度3开始设计先发散思维,头脑风暴,提炼出logo的核心关键词,记录4草图为了快速记录稍纵即逝的灵感......
  • ESP32+RS485参考代码要点+@环境esp-idf-v5.1.2 +vscode 草稿
    在环境esp-idf-v5.1.2+vscode 中,如何在一个文件内,调用另外一个文件夹内定义的函数。 设置帧内间隔(在传输线上,两个发送的字节之间的时间间隔,不超过3.5发送单个字节的时间。)通过函数esp_err_tuart_set_rx_timeout(uart_port_tuart_num,constuint8_ttout_thresh)实现此......
  • 刘铁猛C#学习笔记(草稿)
    C#笔记目录C#笔记刘铁猛网课005C#语言基本元素概览、初识变量与方法、算法简介构成C#语言的基本元素初识类型、变量和方法算法简介作业006,007详解类型、变量与对象(重要)006详解类型、变量与对象上什么是类型(Type)类型在C#语言中的作用007详解类型、变量与对象下C#语言的类型系统......
  • 冯梓轩第二个月学习总结
    第二个月学习总结知识总结这个月主要学习了组合数学、线性代数和数据结构。组合数学方面,主要学习了各种计数、卢卡斯定理和扩展卢卡斯。原先我很不擅长计数类的问题,但是学了之后感觉稍微要好一点了。线性代数主要学习了矩阵和高斯消元。之前我还是一直比较擅长这一板块,现在经过......
  • 夜莺监控 V7 第二个 beta 版本发布,内置集成故障自愈能力,简化部署
    经过一个半月的打磨改进,夜莺监控V7第二个beta版本发布了,本次发布的主要亮点是内置集成故障自愈能力,简化架构,同时做了其他19项改进。一些重要的改进如下:feat:集成故障自愈的能力,不需要再单独部署ibex模块了refactor:内置仪表盘和内置规则页面重构refactor:业务组树......
  • 【转载】[Excel] Excel打开第二个文件很慢的解决方法
    问题描述        该问题具体表现为:当打开第一个Excel文件后,在不关闭它的情况下接着打开第二个Excel文件,第二个Excel文件会延迟几秒之后才会正常打开。        注意,前提是第一个Excel文件打开速度是正常的,否则本解决方案大概率对你无效。    我的环境......
  • postgresql 截取第二个特定字符
    在开发PostgreSQL数据库应用程序时,经常需要在查询语句中截取字符串。在某些情况下,需要截取字符串中的特定字符。例如,从URL中获取域名,从文本中获取文件名等。本文将介绍如何在PostgreSQL中截取字符串中的第二个特定字符。我们将使用SUBSTRING和POSITION函数来实现这一目......
  • 简单顺序链- - 将第一个链的输出作为第二个链的输入
    fromlangchain.chainsimportLLMChain,SimpleSequentialChain#简单序列链fromlangchain_community.llms.ollamaimportOllamafromlangchain_core.promptsimportPromptTemplatellm=Ollama(model="qwen:7b")template="""您的工作是根据用户建议的区域制......
  • 第二个OpenGL程序,矩形 (VAO VBO)_后续 EBO
    效果: 代码main.cpp#include<iostream>#include<glad/glad.h>#include<glfw3.h>usingnamespacestd;//回调函数,每当窗口改变大小,视口大小也跟随改变voidframebuffer_size_callback(GLFWwindow*window,intwidth,intheight){glViewport(0,0,width,heigh......