library(CDIPATools) knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The linear interpolation equation to be used in the base function is below. The y0 and y1 would be either BMI or Media exposure variable. The x0 and x1 would be the time variable.
The y variable is the missing value we are looking for at time x. For BMI variable, the x corresponds to a time from Media exposure that is missing between the x0 and the x1 intervals. The inverse can be said of the Media Exposure variable to BMI as well.
Source: Linear Interpolation, Wikipedia
For 2-D Linear Interpolation, we have to provide 2 pairs of (x,y) coordinates and 1 coordinate point corresponding to the missing value.
missing.y <- LinInterpolate(3,5,1,3,2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.