R语言ToothGrowth 牙齿生长数据分析报告 (附代码数据)_第1页
R语言ToothGrowth 牙齿生长数据分析报告 (附代码数据)_第2页
R语言ToothGrowth 牙齿生长数据分析报告 (附代码数据)_第3页
R语言ToothGrowth 牙齿生长数据分析报告 (附代码数据)_第4页
R语言ToothGrowth 牙齿生长数据分析报告 (附代码数据)_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、R语言ToothGrowth牙齿生长数据分析报告牙齿生长分析探索性数据分析我们将直接加载数据并理解其结构data(ToothGrowth)glimpse(ToothGrowth)#Observations:60#Variables:3#$len4.2,11.5,7.3,5.8,6.4,10.0,11.2,11.2,5.2,7.0,16.#$suppVC,VC,VC,VC,VC,VC,VC,VC,VC,VC,VC,VC,VC,VC,.#$dose0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1.0,1.table(ToothGrowth$dose)#0.512#

2、202020levels(ToothGrowth$supp)#1OJVC剂量有三个价值,这将作为一个因素更好地为我们服务。ToothGrowth$dose-as.factor(ToothGrowth$dose)让我们来分析不同剂量水平的成牙质细胞的长度的分布。doselen-ggplot(ToothGrowth,aes(x=dose,y=len)doselen-doselen+geom_violin(aes(color=dose),trim=F)+ggtitle(Lengthofodontoblastsvs.DoseLevel)+theme(plot.title=element_text(hj

3、ust=0.5)+xlab(VitaminCDoselevel)+ylab(Lengthofodontoblasts)doselendoselensupp-doselen+facet_wrap(supp)+ggtitle(Lengthofodontoblastsvs.DoseLevelwithDeliverymethods)+theme(plot.title=element_text(hjust=0.5)+xlab(VitaminCDoselevel)+ylab(Lengthofodontoblasts)doselensupp匸匚D1%group_by(supp)%summarize(mean

4、_length=mean(len)#Atibble:2x2#suppmean_length#1OJ20.66333【原创】R语言案例数据分析报告论文(附代码数据)有问题到淘宝找“大数据部落”就可以了#2VC16.96333ToothGrowth%groupby(supp)%summarize(maxlength=max(len)#Atibble:2x2#suppmaxlength#1OJ30.9#2VC33.9ToothGrowth%group_by(supp)%summarize(var_length=var(len)#Atibble:2x2#suppvar_length#1OJ43.633

5、44#2VC68.32723SoOJhashigheraveragelengthofodontoblasts,butdoesnthavemaximumvalue.Atthesametime,OJhasmuchlessvariance.Hypothesisteststocomparetoothgrowthbysuppanddose.Nowwellrunmultiplehypothesistestswithdifferentvaluesofsuppanddoseandlaterdetermineifwecanrejectthenullhypothesis.Wellstartwithdifferen

6、tvaluesofdoselevels.t.test(lendose,paired=F,var.equal=F,data=subset(ToothGrowth,dose%in%c(0.5,1)#WelchTwoSamplet-test#data:lenbydose#t=-6.4766,df=37.986,p-value=1.268e-07#alternativehypothesis:truedifferenceinmeansisnotequalto0#95percentconfidenceinterval:#-11.983781-6.276219#sampleestimates:#meanin

7、group0.5meaningroup1【原创】R语言案例数据分析报告论文(附代码数据)有问题到淘宝找“大数据部落”就可以了#10.60519.735t.test(lendose,paired=F,var.equal=F,data=subset(ToothGrowth,dose%in%c(1,2)#WelchTwoSamplet-test#data:lenbydose#t=-4.9005,df=37.101,p-value=1.906e-05#alternativehypothesis:truedifferenceinmeansisnotequalto0#95percentconfidence

8、interval:#-8.996481-3.733519#sampleestimates:#meaningroup1meaningroup2#19.73526.100t.test(lendose,paired=F,var.equal=F,data=subset(ToothGrowth,dose%in%c(0.5,2)#WelchTwoSamplet-test#data:lenbydose#t=-11.799,df=36.883,p-value=4.398e-14#alternativehypothesis:truedifferenceinmeansisnotequalto0#95percent

9、confidenceinterval:#-18.15617-12.83383#sampleestimates:#meaningroup0.5meaningroup2#10.60526.100Lookingattheconfidenceintervalsandp-valuesforthe3conductedt-tests,wecaneasilyrejectthenullhypothesis.Nowweturnourattentiontosuppvalues.t.test(lensupp,paired=F,var.equal=F,data=subset(ToothGrowth,dose=0.5)#

10、WelchTwoSamplet-test#data:lenbysupp#t=3.1697,df=14.969,p-value=0.006359#alternativehypothesis:truedifferenceinmeansisnotequalto0#95percentconfidenceinterval:#1.7190578.780943#sampleestimates:#meaningroupOJmeaningroupVC#13.237.98t.test(lensupp,paired=F,var.equal=F,data=subset(ToothGrowth,dose=1)#Welc

11、hTwoSamplet-test#data:lenbysupp#t=4.0328,df=15.358,p-value=0.001038#alternativehypothesis:truedifferenceinmeansisnotequalto0#95percentconfidenceinterval:#2.8021489.057852#sampleestimates:#meaningroupOJmeaningroupVC#22.7016.77t.test(lensupp,paired=F,var.equal=F,data=subset(ToothGrowth,dose=2)#WelchTw

12、oSamplet-test#data:lenbysupp#t=-0.046136,df=14.04,p-value=0.9639#alternativehypothesis:truedifferenceinmeansisnotequalto0#-3.798073.63807#sampleestimates:95percentconfidenceinterval:#26.0626.14meaningroupOJmeaningroupVCHerefordoselevel2,wecantrejectthenullhypothesissincetheconfidenceintervalcontains0.ConclusionsandassumptionsLookingattheconductedt-tests,wecanconcludethattoothgrowthispri

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论