Title: | Estimating the Incubation Period Distribution of Post-Infectious Syndrome |
---|---|
Description: | Functions to estimate the incubation period distribution of post-infectious syndrome which is defined as the time between the symptom onset of the antecedent infection and that of the post-infectious syndrome. |
Authors: | Char Leung |
Maintainer: | Char Leung <[email protected]> |
License: | GPL-2 |
Version: | 0.1.0 |
Built: | 2024-11-16 04:34:06 UTC |
Source: | https://github.com/cran/postinfectious |
This function estimates the incubation period distribution of a post-infectious syndrome with maximum likelihood estimation. The incubation period distribution of the antecedent infection and the post-infectious syndrome are allowed to be lognormal ("LN
"), Weibull ("WB
") or gamma ("GM
") distributed. The data set is allowed to have cases with the actecedent diseases whose incuation periods come from different distributions (see Examples).
pis.fit(data,postinfect=c("LN","WB","GM"),theta)
pis.fit(data,postinfect=c("LN","WB","GM"),theta)
data |
A data.frame containing at least 4 columns. The first two columns represent (1) the time between the symptom onset of the antecedent infection and post-infectious syndrome and (2) the incubation period distribution of the antecedent infection (only " |
postinfect |
The incubation period distribution of the post-infectious disease. It can only be " |
theta |
A vector of two numbers as the initial value for optimisation. |
For each observed case, let and
be the incubation period of the antecedent infection and post-infectious syndrome, respectively. As the antecedent infection is the antigenic factor of the post-infectious syndrome, they both share the same time of infection exposure. The difference between
and
, denoted by
, is the time between the two symptom onsets. Also let
and
be the set of the parameters of the distribution of
and
then the likelihood of such observed case is given by,
where and
are the probability density function of
and
, respectively.
is then estimated by maximising the sum of likelihood of all observed cases.
Parameter |
Estimates of the parameters of the incubation period distribution of the post-infectious syndrome. |
SE |
Standard errors of |
AIC |
Akaike Information Criterion. |
Convergence |
The convergence message of |
Median |
The median incubation period distribution of the post-infectious syndrome. |
Theta.initial |
Initial values used in |
Distribution |
The Distribution assumed in the estimation, i.e. " |
Char Leung
#generate artificial data S<-c(56,37,32,7,8,3,5) S0<-c(2,1,3,1,1,1,3) X<-S-S0 f0<-c(rep("LN",4),rep("WB",3)) phi<-matrix(c(rep(c(0,1),4),rep(c(1,2),3)),byrow=TRUE,ncol=2) data<-data.frame(X,f0,phi) pis.fit(data,"LN",theta=c(2.5,1))
#generate artificial data S<-c(56,37,32,7,8,3,5) S0<-c(2,1,3,1,1,1,3) X<-S-S0 f0<-c(rep("LN",4),rep("WB",3)) phi<-matrix(c(rep(c(0,1),4),rep(c(1,2),3)),byrow=TRUE,ncol=2) data<-data.frame(X,f0,phi) pis.fit(data,"LN",theta=c(2.5,1))
pis.fit
This function creates bootstrap estimates of the output of pis.fit
by creating bootstrap samples
pis.fit.boots(data,postinfect=c("LN","WB","GM"),theta,n.boots=1000,collective=100)
pis.fit.boots(data,postinfect=c("LN","WB","GM"),theta,n.boots=1000,collective=100)
data |
A data.frame containing at least 4 columns. The first two columns represent (1) the time between the symptom onset of the antecedent infection and post-infectious syndrome and (2) the incubation period distribution of the antecedent infection (only " |
postinfect |
The incubation period distribution of the post-infectious disease. It can only be " |
theta |
Text input only and it is an R expression to be evaluated (i.e. |
n.boots |
The number of bootstrap samples. |
collective |
The number of bootstrap samples to be estimated at once as the estimation process uses the |
Same as those in pis.fit
.
Char Leung
pis.fit
S<-c(56,37,32,7,8,3,5) S0<-c(2,1,3,1,1,1,3) X<-S-S0 f0<-c(rep("LN",4),rep("WB",3)) phi<-matrix(c(rep(c(0,1),4),rep(c(1,2),3)),byrow=TRUE,ncol=2) data<-data.frame(X,f0,phi) pis.fit.boots(data,"LN",theta="c(runif(1,2,3),runif(1,0,1))",n.boots=20,collective=15)
S<-c(56,37,32,7,8,3,5) S0<-c(2,1,3,1,1,1,3) X<-S-S0 f0<-c(rep("LN",4),rep("WB",3)) phi<-matrix(c(rep(c(0,1),4),rep(c(1,2),3)),byrow=TRUE,ncol=2) data<-data.frame(X,f0,phi) pis.fit.boots(data,"LN",theta="c(runif(1,2,3),runif(1,0,1))",n.boots=20,collective=15)