Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_babies.wasp
Title produced by softwareExercise 1.13
Date of computationMon, 11 Oct 2010 11:24:19 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Oct/11/t1286796172rsfwhbylcwhybll.htm/, Retrieved Thu, 28 Mar 2024 15:45:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=82440, Retrieved Thu, 28 Mar 2024 15:45:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact479
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Exercise 1.13] [babies] [2010-10-11 11:24:19] [d76b387543b13b5e3afd8ff9e5fdc89f] [Current]
- RM      [Exercise 1.13] [WS 2 - 2 ] [2011-10-17 10:30:41] [2c786c21adba4dd4c8af44dce5258f06]
- R       [Exercise 1.13] [Paper 1.1.1. Babi...] [2011-12-06 14:37:17] [9d4f280afcb4ecc352d7c6f913a0a151]
- R       [Exercise 1.13] [Paper 1.1.1. Babi...] [2011-12-06 15:05:06] [9d4f280afcb4ecc352d7c6f913a0a151]
- R P     [Exercise 1.13] [] [2012-12-10 17:15:44] [4187c7efada0bc11e94a41d61d855f64]
- RMP     [Exercise 1.13] [WS2 Task 3] [2014-10-08 10:44:55] [074b0dbc8d3b700fa15927150828e345]
- RM      [Exercise 1.13] [] [2014-10-08 11:21:42] [9b99fe494671b75fb711c2dc543f4e3e]
- RMP     [Exercise 1.13] [Babies more accur...] [2014-10-08 11:50:33] [40df8d8b5657a9599acc6ccced535535]
- RM      [Exercise 1.13] [Task 2 WS2] [2014-10-08 12:20:49] [805021881bfa5340347077d26b077617]
- RM      [Exercise 1.13] [Probability 10 years] [2014-10-08 12:55:51] [837635e05a8b7d15572545de61d5b5ed]
- RM      [Exercise 1.13] [ws2 task 2] [2014-10-08 12:58:21] [99723d3e379f668157309b7b2091b15d]
-   P       [Exercise 1.13] [ws2 task 3] [2014-10-08 13:10:59] [99723d3e379f668157309b7b2091b15d]
- RM      [Exercise 1.13] [Probability 80 %] [2014-10-08 13:11:08] [837635e05a8b7d15572545de61d5b5ed]
- RM      [Exercise 1.13] [] [2014-10-08 13:23:29] [1a6d42b46b3d01bc960fcfb45e99fecd]
- R         [Exercise 1.13] [] [2014-10-08 14:02:43] [1a6d42b46b3d01bc960fcfb45e99fecd]
- RMP     [Exercise 1.13] [] [2014-10-08 15:09:01] [69bf0eb8b9b38defaaf4848d8c317571]
- RMP     [Exercise 1.13] [] [2014-10-08 15:11:26] [69bf0eb8b9b38defaaf4848d8c317571]
- RM      [Exercise 1.13] [Compendium 2 task 2] [2014-10-08 16:01:58] [006b54b8ce76f482b86cd20c6480b526]
- RM      [Exercise 1.13] [] [2014-10-09 14:31:26] [95c11abf048d3a1e472aeccb09199113]
- RMP     [Exercise 1.13] [WS2 Task 2] [2014-10-09 15:19:26] [be945163e51ed825733188af308451be]
- RM      [Exercise 1.13] [WST2] [2014-10-09 16:36:01] [784816b0c716a476fc48ddde921cf7ea]
- RM      [Exercise 1.13] [] [2014-10-09 17:01:52] [02fb6cbf799bcf1e525e4e01c2f27ada]
- RMP     [Exercise 1.13] [] [2014-10-09 17:06:16] [02fb6cbf799bcf1e525e4e01c2f27ada]
- RM      [Exercise 1.13] [small] [2014-10-09 18:56:17] [c2c160edf30e228bd3a949bf24376c2c]
-           [Exercise 1.13] [small hospital] [2014-10-09 19:00:24] [c2c160edf30e228bd3a949bf24376c2c]
- RM          [Exercise 1.13] [small hospital] [2014-10-09 19:01:23] [c2c160edf30e228bd3a949bf24376c2c]
- RM      [Exercise 1.13] [lara] [2014-10-16 16:56:13] [26c5585f12aed8f60819b127d2b55398]
- RMP     [Exercise 1.13] [] [2015-01-14 17:10:53] [cf1a47f8a34e6bc0b1659ece49000b49]
-           [Exercise 1.13] [] [2015-01-14 17:13:56] [cf1a47f8a34e6bc0b1659ece49000b49]
-             [Exercise 1.13] [] [2015-01-14 17:31:29] [cf1a47f8a34e6bc0b1659ece49000b49]
Feedback Forum

Post a new message




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'George Udny Yule' @ 72.249.76.132

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 7 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=82440&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]7 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=82440&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=82440&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'George Udny Yule' @ 72.249.76.132







Exercise 1.13 p. 14 (Introduction to Probability, 2nd ed.)
Number of simulated days3650
Expected number of births in Large Hospital45
Expected number of births in Small Hospital15
Percentage of Male births per day(for which the probability is computed)0.6
#Females births in Large Hospital82299
#Males births in Large Hospital81951
#Female births in Small Hospital27280
#Male births in Small Hospital27470
Probability of more than 60 % of male births in Large Hospital0.0580821917808219
Probability of more than 60 % of male births in Small Hospital0.158356164383562
#Days per Year when more than 60 % of male births occur in Large Hospital21.2
#Days per Year when more than 60 % of male births occur in Small Hospital57.8

\begin{tabular}{lllllllll}
\hline
Exercise 1.13 p. 14 (Introduction to Probability, 2nd ed.) \tabularnewline
Number of simulated days & 3650 \tabularnewline
Expected number of births in Large Hospital & 45 \tabularnewline
Expected number of births in Small Hospital & 15 \tabularnewline
Percentage of Male births per day(for which the probability is computed) & 0.6 \tabularnewline
#Females births in Large Hospital & 82299 \tabularnewline
#Males births in Large Hospital & 81951 \tabularnewline
#Female births in Small Hospital & 27280 \tabularnewline
#Male births in Small Hospital & 27470 \tabularnewline
Probability of more than 60 % of male births in Large Hospital & 0.0580821917808219 \tabularnewline
Probability of more than 60 % of male births in Small Hospital & 0.158356164383562 \tabularnewline
#Days per Year when more than 60 % of male births occur in Large Hospital & 21.2 \tabularnewline
#Days per Year when more than 60 % of male births occur in Small Hospital & 57.8 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=82440&T=1

[TABLE]
[ROW][C]Exercise 1.13 p. 14 (Introduction to Probability, 2nd ed.)[/C][/ROW]
[ROW][C]Number of simulated days[/C][C]3650[/C][/ROW]
[ROW][C]Expected number of births in Large Hospital[/C][C]45[/C][/ROW]
[ROW][C]Expected number of births in Small Hospital[/C][C]15[/C][/ROW]
[ROW][C]Percentage of Male births per day(for which the probability is computed)[/C][C]0.6[/C][/ROW]
[ROW][C]#Females births in Large Hospital[/C][C]82299[/C][/ROW]
[ROW][C]#Males births in Large Hospital[/C][C]81951[/C][/ROW]
[ROW][C]#Female births in Small Hospital[/C][C]27280[/C][/ROW]
[ROW][C]#Male births in Small Hospital[/C][C]27470[/C][/ROW]
[ROW][C]Probability of more than 60 % of male births in Large Hospital[/C][C]0.0580821917808219[/C][/ROW]
[C]Probability of more than 60 % of male births in Small Hospital[/C][C]0.158356164383562[/C][/ROW]
[ROW][C]#Days per Year when more than 60 % of male births occur in Large Hospital[/C][C]21.2[/C][/ROW]
[C]#Days per Year when more than 60 % of male births occur in Small Hospital[/C][C]57.8[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=82440&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=82440&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Exercise 1.13 p. 14 (Introduction to Probability, 2nd ed.)
Number of simulated days3650
Expected number of births in Large Hospital45
Expected number of births in Small Hospital15
Percentage of Male births per day(for which the probability is computed)0.6
#Females births in Large Hospital82299
#Males births in Large Hospital81951
#Female births in Small Hospital27280
#Male births in Small Hospital27470
Probability of more than 60 % of male births in Large Hospital0.0580821917808219
Probability of more than 60 % of male births in Small Hospital0.158356164383562
#Days per Year when more than 60 % of male births occur in Large Hospital21.2
#Days per Year when more than 60 % of male births occur in Small Hospital57.8



Parameters (Session):
par1 = 3650 ; par2 = 45 ; par3 = 15 ; par4 = 0.6 ;
Parameters (R input):
par1 = 3650 ; par2 = 45 ; par3 = 15 ; par4 = 0.6 ;
R code (references can be found in the software module):
par1 <- as.numeric(par1)
par2 <- as.numeric(par2)
par3 <- as.numeric(par3)
par4 <- as.numeric(par4)
numsuccessbig <- 0
numsuccesssmall <- 0
bighospital <- array(NA,dim=c(par1,par2))
smallhospital <- array(NA,dim=c(par1,par3))
bigprob <- array(NA,dim=par1)
smallprob <- array(NA,dim=par1)
for (i in 1:par1) {
bighospital[i,] <- sample(c('F','M'),par2,replace=TRUE)
if (as.matrix(table(bighospital[i,]))[2] > par4*par2) numsuccessbig = numsuccessbig + 1
bigprob[i] <- numsuccessbig/i
smallhospital[i,] <- sample(c('F','M'),par3,replace=TRUE)
if (as.matrix(table(smallhospital[i,]))[2] > par4*par3) numsuccesssmall = numsuccesssmall + 1
smallprob[i] <- numsuccesssmall/i
}
tbig <- as.matrix(table(bighospital))
tsmall <- as.matrix(table(smallhospital))
tbig
tsmall
numsuccessbig/par1
bigprob[par1]
numsuccesssmall/par1
smallprob[par1]
numsuccessbig/par1*365
bigprob[par1]*365
numsuccesssmall/par1*365
smallprob[par1]*365
bitmap(file='test1.png')
plot(bigprob,col=2,main='Probability in Large Hospital',xlab='#simulated days',ylab='probability')
dev.off()
bitmap(file='test2.png')
plot(smallprob,col=2,main='Probability in Small Hospital',xlab='#simulated days',ylab='probability')
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Exercise 1.13 p. 14 (Introduction to Probability, 2nd ed.)',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Number of simulated days',header=TRUE)
a<-table.element(a,par1)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Expected number of births in Large Hospital',header=TRUE)
a<-table.element(a,par2)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Expected number of births in Small Hospital',header=TRUE)
a<-table.element(a,par3)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Percentage of Male births per day
(for which the probability is computed)',header=TRUE)
a<-table.element(a,par4)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#Females births in Large Hospital',header=TRUE)
a<-table.element(a,tbig[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#Males births in Large Hospital',header=TRUE)
a<-table.element(a,tbig[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#Female births in Small Hospital',header=TRUE)
a<-table.element(a,tsmall[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#Male births in Small Hospital',header=TRUE)
a<-table.element(a,tsmall[2])
a<-table.row.end(a)
a<-table.row.start(a)
dum1 <- paste('Probability of more than', par4*100, sep=' ')
dum <- paste(dum1, '% of male births in Large Hospital', sep=' ')
a<-table.element(a, dum, header=TRUE)
a<-table.element(a, bigprob[par1])
a<-table.row.end(a)
dum <- paste(dum1, '% of male births in Small Hospital', sep=' ')
a<-table.element(a, dum, header=TRUE)
a<-table.element(a, smallprob[par1])
a<-table.row.end(a)
a<-table.row.start(a)
dum1 <- paste('#Days per Year when more than', par4*100, sep=' ')
dum <- paste(dum1, '% of male births occur in Large Hospital', sep=' ')
a<-table.element(a, dum, header=TRUE)
a<-table.element(a, bigprob[par1]*365)
a<-table.row.end(a)
dum <- paste(dum1, '% of male births occur in Small Hospital', sep=' ')
a<-table.element(a, dum, header=TRUE)
a<-table.element(a, smallprob[par1]*365)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')