mattg3004 / Measles-Experiment

0 stars 0 forks source link

Age-structurized MSEIRV model for Measles #1

Closed Spatial-R closed 9 years ago

Spatial-R commented 9 years ago

Firstly, i would give you a thanks for sharing your codes in measles. Recently, i have fixed on a study about the health economics evaluation on measles and need build an age-structurized MSEIRV model. In your model, the children will get a measles-contained vaccine in the 0 age group. If i want to give another vaccine in the age at 2 year olds, how could i change the model, especially for the function of stochastic.transmission.matrix. Thanks again!

mattg3004 commented 9 years ago

Thanks for your message. To vaccinate 2 year olds you need to change a few lines of this function. on line 86 there is a condition that says: if (age > 0) { vacc.immune = 0 }

change this to if (age > 0 & age != 2) { vacc.immune = 0 }

Also on line 103 change the condition if(age == 0 )

to if(age == 0 | age == 2)

Hopefully that helps with your work. Matt

Spatial-R commented 9 years ago

Thanks!If the vaccine stragety is at 8 months (first dose) and 18~24months (second dose) with different vaccine coverage and vaccine efficicy. how could i change the codes? thanks again!

发自我的小米手机在 mattg3004 notifications@github.com,2015年9月24日 下午10:44写道:Thanks for your message. To vaccinate 2 year olds you need to change a few lines of this function. on line 86 there is a condition that says: if (age > 0) { vacc.immune = 0 }

change this to if (age > 0 & age != 2) { vacc.immune = 0 }

Also on line 103 change the condition if(age == 0 )

to if(age == 0 | age == 2)

Hopefully that helps with your work. Matt

—Reply to this email directly or view it on GitHub.

mattg3004 commented 9 years ago

There is no month specific code, so to do this you will have to adjust the proportions of the vaccination accordingly. So for vaccinating 8 month old children, these compose 1/12th of those aged 0, so you would have to divide your vaccination proportion for these individuals by 12. Similarly for 18-24 months, these are 1/2 of those aged 1, so you divide the proportion by 2 for these. You will also need to change the age==2 conditions to age==1 to do this correctly.

Spatial-R commented 8 years ago

Hello,

I'm sorry to bother you again. In your github you created a age-structured MSEIRV model for measles and it is very useful in my study. However, i also have come across some problems and hope you can help me.

Firstly, the model is based on the hypothesis that the initial percentage of each state in the different ages were all the same, however, it is not true in the actually situation. Therefore, is there any way can help me calculate the initial percentage of  suspected, exposed, infected from a cross-section investigation on antibody test?

Secondly, you calculate the force of infection by ages using the fellow codes:

foi.by.age = 1 - exp(-sum ( beta* ( (number.infectious.by.age)^gamma )*mixing.by.age/population.by.age ) )

Do the beta argeument represent for the mean infection force for all the age group? Besides, do you have any papers that introduce why we use the aboved codes to calculate the infection force at each age group?

Thanks and best wishes!

Bing Zhang

Zhejiang Provincial Center for Disease Control and Prevention

Hangzhou, China


发件人: mattg3004 notifications@github.com 发送时间: 2015年9月24日 15:03 收件人: mattg3004/Measles-Experiment 抄送: Bing Zhang 主题: Re: [Measles-Experiment] Age-structurized MSEIRV model for Measles (#1)

There is no month specific code, so to do this you will have to adjust the proportions of the vaccination accordingly. So for vaccinating 8 month old children, these compose 1/12th of those aged 0, so you would have to divide your vaccination proportion for these individuals by 12. Similarly for 18-24 months, these are 1/2 of those aged 1, so you divide the proportion by 2 for these. You will also need to change the age==2 conditions to age==1 to do this correctly.

― Reply to this email directly or view it on GitHubhttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843.

[https://avatars2.githubusercontent.com/u/5723719?v=3&s=400]https://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843

Age-structurized MSEIRV model for Measles ・ Issue #1 ・ mattg3004/Measles-Experimenthttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843 github.com Firstly, i would give you a thanks for sharing your codes in measles. Recently, i have fixed on a study about the health economics evaluation on measles and need build an age-structurized MSEIRV mo...

mattg3004 commented 8 years ago

Hello, I’m not sure exactly which function you are using, but assuming that you are using the initial.disease.state  function, then it isn't too hard to change this as you want. If you have data which gives the proportion of immune individuals by age, then you can just change the initial.prop.susceptible to be a 1-D matrix which holds the appropriate value for each age group. Then inside the function you just have to edit the initial.prop.susceptible reference to look at the entries of the matrix, e.g. change from initial.prop.susceptible to initial.prop.susceptible[i], where you have to be careful that this value of i refers to the correct entry of the matrix. It would look something like:

for (i in 13:length(list.of.ages)){     disease.state[(((i-1)_num.comps)+1):((i)_num.comps)]      =    round(c(0,                                                                              demographic.ages[(i - 11),2]initial.prop.susceptible[i],                                                                            0,                                                                             0,                                                                             (demographic.ages[(i - 11),2](1-initial.prop.susceptible[i]))))   } and similarly for the under 1’s.

In terms of beta, you are essentially correct yes, this is related to the average strength of the infection. I was calibrating the value of beta, so that it would give me a specified value of R0 when averaged over the whole population. The attached paper by Metcalf et al explains the use of this form for the force of infection, and was the basis for the github code. The Klepac paper explains one way of calibrating the infection matrix for a given value of R0, though this is different from what I do in the github code.

Hope this helps.

Best wishes, Matt On December 30, 2015 at 8:56:07 PM, Bing Zhang (notifications@github.com) wrote:

Hello,

I'm sorry to bother you again. In your github you created a age-structured MSEIRV model for measles and it is very useful in my study. However, i also have come across some problems and hope you can help me.

Firstly, the model is based on the hypothesis that the initial percentage of each state in the different ages were all the same, however, it is not true in the actually situation. Therefore, is there any way can help me calculate the initial percentage of suspected, exposed, infected from a cross-section investigation on antibody test?

Secondly, you calculate the force of infection by ages using the fellow codes:

foi.by.age = 1 - exp(-sum ( beta* ( (number.infectious.by.age)^gamma )*mixing.by.age/population.by.age ) )

Do the beta argeument represent for the mean infection force for all the age group? Besides, do you have any papers that introduce why we use the aboved codes to calculate the infection force at each age group?

Thanks and best wishes!

Bing Zhang

Zhejiang Provincial Center for Disease Control and Prevention

Hangzhou, China


发件人: mattg3004 notifications@github.com 发送时间: 2015年9月24日 15:03 收件人: mattg3004/Measles-Experiment 抄送: Bing Zhang 主题: Re: [Measles-Experiment] Age-structurized MSEIRV model for Measles (#1)

There is no month specific code, so to do this you will have to adjust the proportions of the vaccination accordingly. So for vaccinating 8 month old children, these compose 1/12th of those aged 0, so you would have to divide your vaccination proportion for these individuals by 12. Similarly for 18-24 months, these are 1/2 of those aged 1, so you divide the proportion by 2 for these. You will also need to change the age==2 conditions to age==1 to do this correctly.

― Reply to this email directly or view it on GitHubhttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843.

[https://avatars2.githubusercontent.com/u/5723719?v=3&s=400]https://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843

Age-structurized MSEIRV model for Measles ・ Issue #1 ・ mattg3004/Measles-Experimenthttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843 github.com Firstly, i would give you a thanks for sharing your codes in measles. Recently, i have fixed on a study about the health economics evaluation on measles and need build an age-structurized MSEIRV mo...

— Reply to this email directly or view it on GitHub.

Spatial-R commented 8 years ago

Dear,

 I can't find the papers and could you send me again?

 At the same time, i have some probelms to modify your codes to my study. I guess the model in your github is uesd to do the health-ecconomic analysis on measles vaccination and the immgrate infected population was the trigger in the initial situation. I wonder whether the situation where the initial infeted population is not 0 is also sutiable to use your codes?

In the stochastic.transmission.matrix function, the change.matrix result will have the population left and the population flow to the next age population. Alought the argument beta_0 that measures the avergae number of people infected was based on the mixing.matrix, the contact will also happen among different age groups such as the contact between the age 1 and age 10.  How could i fixed on this probelm?

The beta_1 that measures the sesonal effect (i guess) in your code is 0.8 , if the disease has changed to mumps, do the beta_1 also need be changed?

Thanks again and look foward to hearing from you.

Bing Zhang

Zhejiang Provincial Center for Disease Control and Prevention

Hangzhou, China


发件人: mattg3004 notifications@github.com 发送时间: 2016年1月4日 17:32 收件人: mattg3004/Measles-Experiment 抄送: Bing Zhang 主题: Re: [Measles-Experiment] Age-structurized MSEIRV model for Measles (#1)

Hello, I’m not sure exactly which function you are using, but assuming that you are using the initial.disease.state function, then it isn't too hard to change this as you want. If you have data which gives the proportion of immune individuals by age, then you can just change the initial.prop.susceptible to be a 1-D matrix which holds the appropriate value for each age group. Then inside the function you just have to edit the initial.prop.susceptible reference to look at the entries of the matrix, e.g. change from initial.prop.susceptible to initial.prop.susceptible[i], where you have to be careful that this value of i refers to the correct entry of the matrix. It would look something like:

for (i in 13:length(list.of.ages)){ disease.state[(((i-1)_num.comps)+1):((i)_num.comps)] = round(c(0, demographic.ages[(i - 11),2]initial.prop.susceptible[i], 0, 0, (demographic.ages[(i - 11),2](1-initial.prop.susceptible[i])))) } and similarly for the under 1’s.

In terms of beta, you are essentially correct yes, this is related to the average strength of the infection. I was calibrating the value of beta, so that it would give me a specified value of R0 when averaged over the whole population. The attached paper by Metcalf et al explains the use of this form for the force of infection, and was the basis for the github code. The Klepac paper explains one way of calibrating the infection matrix for a given value of R0, though this is different from what I do in the github code.

Hope this helps.

Best wishes, Matt On December 30, 2015 at 8:56:07 PM, Bing Zhang (notifications@github.com) wrote:

Hello,

I'm sorry to bother you again. In your github you created a age-structured MSEIRV model for measles and it is very useful in my study. However, i also have come across some problems and hope you can help me.

Firstly, the model is based on the hypothesis that the initial percentage of each state in the different ages were all the same, however, it is not true in the actually situation. Therefore, is there any way can help me calculate the initial percentage of suspected, exposed, infected from a cross-section investigation on antibody test?

Secondly, you calculate the force of infection by ages using the fellow codes:

foi.by.age = 1 - exp(-sum ( beta* ( (number.infectious.by.age)^gamma )*mixing.by.age/population.by.age ) )

Do the beta argeument represent for the mean infection force for all the age group? Besides, do you have any papers that introduce why we use the aboved codes to calculate the infection force at each age group?

Thanks and best wishes!

Bing Zhang

Zhejiang Provincial Center for Disease Control and Prevention

Hangzhou, China


发件人: mattg3004 notifications@github.com 发送时间: 2015年9月24日 15:03 收件人: mattg3004/Measles-Experiment 抄送: Bing Zhang 主题: Re: [Measles-Experiment] Age-structurized MSEIRV model for Measles (#1)

There is no month specific code, so to do this you will have to adjust the proportions of the vaccination accordingly. So for vaccinating 8 month old children, these compose 1/12th of those aged 0, so you would have to divide your vaccination proportion for these individuals by 12. Similarly for 18-24 months, these are 1/2 of those aged 1, so you divide the proportion by 2 for these. You will also need to change the age==2 conditions to age==1 to do this correctly.

D Reply to this email directly or view it on GitHubhttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843.

[https://avatars2.githubusercontent.com/u/5723719?v=3&s=400]https://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843

Age-structurized MSEIRV model for Measles ? Issue #1 ? mattg3004/Measles-Experimenthttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-142955843 github.com Firstly, i would give you a thanks for sharing your codes in measles. Recently, i have fixed on a study about the health economics evaluation on measles and need build an age-structurized MSEIRV mo...

― Reply to this email directly or view it on GitHub.

― Reply to this email directly or view it on GitHubhttps://github.com/mattg3004/Measles-Experiment/issues/1#issuecomment-168745718.

mattg3004 commented 8 years ago

Hello, I’ve attached the papers again, hopefully you can see them now. If not, these are the links: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4086157/ http://rspb.royalsocietypublishing.org/content/276/1666/2469

You should definitely be able to include an initial infected number of individuals, this will work fine. Just add the desired infecteds to the initial disease state.

I’m not sure I fully understand your second question about beta_0. I think you are essentially asking can an infected individual of age 1 infect an age 10 individual. Is this correct? If so, then this is taken care of in the code, as the force of infection on each age group is calculated by considering the number of infected individuals in all age groups, and how they interact with each other via the mixing matrix. This is what is done during the foi.by.age step that you asked about a few days age. If the question is something different then let me know.

You are correct about the beta_1 use. I don’t know anything about the transmission of mumps, but if it has a different seasonal effect, then you would need to change it to whatever value makes most sense.

Thanks Matt

On January 8, 2016 at 6:24:36 AM, Bing Zhang (notifications@github.com) wrote:

How could i fixed on this probelm

Spatial-R commented 8 years ago

I meant that, after running the function stochastic.transmission.matrix., i will get a matrix that includes two parts: the firts part(1:num.comps) means the situation left in the age group after everytime.step, the second part means the transimission situation from age to age+1 group. However, the age group also will contact with age+n group and make the individual in age+n group infected. If we calculate the force of infection on each age group based on the number of infected individuals in all age groups, the second parts in the function will don't represent for the population flow to the next age population but for the the total population. Moreover, we need update the situation of age+1 group with the flow from the age group. Therefore, i wonder that whether we calculate the the force of infection between the age group and other groups respectively and then update the situation in the different age groups?

mattg3004 commented 8 years ago

I’m not really sure that I follow what you wrote in the last email. Do you mean that because we are updating the ages of each age group in turn and calculating the force of infection on them in turn, then we are getting the wrong force of infection as the population for younger individuals has been updated already? If so, then this isn’t the case, as the state at the time of the time step is used to calculate the force of infections, and then this is updated at the end of the loop which updates all ages and states. Hope that this helps.

On January 9, 2016 at 11:10:13 PM, Bing Zhang (notifications@github.com) wrote:

I meant that, after running the function stochastic.transmission.matrix., i will get a matrix that includes two parts: the firts part(1:num.comps) means the situation left in the age group after everytime.step, the second part means the transimission situation from age to age+1 group. However, the age group also will contact with age+n group and make the individual in age+n group infected. If we calculate the force of infection on each age group based on the number of infected individuals in all age groups, the second parts in the function will don't represent for the population flow to the next age population but for the the total population. Moreover, we need update the situation of age+1 group with the flow from the age group. Therefore, i wonder that whether we calculate the the force of infection between the age group and other groups respectively and then update the situation in the diff erent age groups?

— Reply to this email directly or view it on GitHub.