Description Usage Arguments Value Examples
Internal function to help in matching observations.
1 | find_one_near(o, m, n_near = 5)
|
o |
is a value to match |
m |
is a named vector which is used to find a nearest match to the |
n_near |
number of the nearest observations to derive a random match. If 'n_near' is greater than 'length(match_vector)', minimum out of two is used to create a sample for selecting a random match value. |
It produces a list of four elements:
'period_1_id
position of the o
(observation element in the named vector)
y1_hat
value of the o
period_0_id
position of the nearest match in the alternatives vector m
y0_hat
value of the nearest match.
1 2 3 4 5 | library(syntheticpanel)
find_one_near(c("a" = 10), c(8:15), 3)
find_one_near(c("a" = 10), setNames(c(8:15), letters[1:8]), 5)
find_one_near(c(9), setNames(c(8:15), letters[1:8]), 5)
find_one_near(c(10), c(8:15), 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.