2018年7月17日火曜日

T test to compare before and after the new drug prescribed.


t.test(as.vector(last(bp.bangkok["::2018-06-20"][,2],n=length(as.vector(bp.bangkok["2018-06-21::"][,2])))),as.vector(bp.bangkok["2018-06-21::"][,2]))
par(mfrow=c(2,1))
hist(as.vector(last(bp.bangkok["::2018-06-20"][,2],n=length(as.vector(bp.bangkok["2018-06-21::"][,2])))),breaks=20,xlim=c(55,100),ylim=c(0,10),col=3)
hist(as.vector(bp.bangkok["2018-06-21::"][,2]),breaks=20,xlim=c(55,100),ylim=c(0,10),col=2)
par(mfrow=c(1,1))
#
# mean value before
#
mean(last(bp.bangkok["::2018-06-20"][,2],n=length(as.vector(bp.bangkok["2018-06-21::"][,2]))))
#
# mean value after
#
mean(as.vector(bp.bangkok["2018-06-21::"][,2]))

  • 2018-06-20 is the day to start to add the new drug for me.
  • Comparing low blood pressure before and after the date.
  • The number of sample is standardized.
  • Drawing histograms to compare graphically.


0 件のコメント: