Description Usage Arguments Details Value Author(s) Examples
Find the best selection of individual records for a census area.
1 | find_best_selection(area, insms, inseed = -1)
|
area |
A census area |
insms |
A microsimulation object which holds the data and details of the simulation such as iterations, lexicon. |
inseed |
test |
Calculate the best area representation, after a series of selection tries.
list A list with results (#areaid, #selection, #tae, #tries, #error_states).
Dimitris Kavroudakis dimitris123@gmail.com
1 2 3 4 5 6 7 8 9 10 11 | library(sms)
data(survey) #load the data
data(census)
in.lexicon=createLexicon() # Create a data lexicon for holding the associated column names.
in.lexicon=addDataAssociation(in.lexicon, c("he","he"))
in.lexicon=addDataAssociation(in.lexicon, c("females","female"))
this_area=as.data.frame(census[1,]) #Select the first area from the census table
insms= new("microsimulation",census=census,panel=survey, lexicon=in.lexicon, iterations=10)
best=find_best_selection(this_area, insms)
print(best)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.