/
2anesrakeIndex13 2anesrakeIndex13

2anesrakeIndex13 - PDF document

liane-varnes
liane-varnes . @liane-varnes
Follow
360 views
Uploaded On 2015-10-03

2anesrakeIndex13 - PPT Presentation

anes04DemographicDataFrom2004AmericanNationalElectionStudiesANES DescriptionAdatasetcontainingdemographicdatafromthe2004AmericanNationalElectionStudiesThedatainclude5variablesfemaleALogicalVari ID: 148050

anes04DemographicDataFrom2004AmericanNationalElectionStudies(ANES) DescriptionAdatasetcontainingdemographicdatafromthe2004AmericanNationalElectionStudies.Thedatainclude5variables:"female"(ALogicalVari

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "2anesrakeIndex13" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Package`anesrake'April28,2018Version0.80Date2018-04-27TitleANESRakingImplementationAuthorJoshPasek[aut,cre]MaintainerJoshPasek&#xjosh;&#x@jos;&#xhpas;k.c;&#xom00;DependsHmisc,weightsDescriptionProvidesacomprehensivesystemforselectingvariablesandweightingdatatomatchthespecicationsoftheAmericanNationalElectionStudies.Thepackageincludesmethodsforidentifyingdiscrepantvariables,rakingdata,andassessingtheeffectsoftherakingalgorithm.Italsoallowsautomatedre-rakingiftargetvariablesfalloutsideidentiedboundsandallowsgreateruserspecicationthanotheravailablerakingalgorithms.Avarietyofsimpleweightedstatisticsthatwerepreviouslyinthispackage(version.55andearlier)havebeenmovedtothepackageweights.LicenseGPL&#xjosh;&#x@jos;&#xhpas;k.c;&#xom00;(=2)LazyLoadyesNeedsCompilationnoRepositoryCRANDate/Publication2018-04-2809:23:18UTCRtopicsdocumented:anes04............................................2anesrake...........................................2anesrakender........................................6discrep............................................8generaldesigneffect.....................................9rakelist............................................9weightassess.........................................11Index131 2anesrake anes04DemographicDataFrom2004AmericanNationalElectionStudies(ANES) DescriptionAdatasetcontainingdemographicdatafromthe2004AmericanNationalElectionStudies.Thedatainclude5variables:"female"(ALogicalVariableIndicatingSex),"age"(NumericallyCoded,RangingFrom18toaTopcodeof90),"educats"(5EducationCategoriescorrespondingto1-LessthanAHighSchoolDegree,2-HighSchoolGradutate,3-SomeCollege,4-CollegeGraduate,5-PostCollegeEducation),"racecats"(6RacialCategories),and"married"(ALogicalVariableIndicatingtheRespondent'sMaritalStatus,withonepointofmissingdata).Datasetisdesignedshowhowproductionofsurveyweightsworksinpractice.Usagedata(anes04)FormatTheformatis:chr"anes04"Sourcehttp://www.electionstudies.org anesrakeFunctiontoperformfullANESvariableselectionandweighting. DescriptionanesraketakesalistofvariablesandtargetvaluesanddetermineshowtheyshouldbeweightedtomatchtheproceduresoutlinedinDeBellandKrosnick,2009.Itthenperformsrakingtodevelopweightsforthevariablesselectedsuchthattheymatchthetargetsprovided.Usageanesrake(inputter,dataframe,caseid,weightvec=NULL,cap=5,verbose=FALSE,maxit=1000,type="pctlim",pctlim=5,nlim=5,filter=1,choosemethod="total",iterate=TRUE,convcrit=0.01,force1=TRUE,center.baseweights=TRUE) anesrake3ArgumentsinputterTheinputterobjectshouldcontainalistofalltargetvaluesfortherakingprocedure.Eachlistelementininputtershouldbeavectorcorrespondingtotheweightingtargetsforasinglevariable.Hence,thevectorenumeratingtheweightingtargetsforavariablewith2levelsshouldbeoflength2,whileavectorenumeratingtheweightingtargetsforavariablewith5levelsshouldbeoflength5.Listelementsininputtershouldbenamedaccordingtothevariablethattheywillmatchinthecorrespondingdataset.Hence,alistelementenumeratingtheproportionofthesamplethatshouldbeofeachgendershouldbelabeled"female"ifthevariableindataframeisalsotitled"female."inputterelementsmustbevectorsandcanbeofclassnumeric,orfactorandmustmatchtheclassofthecorrespondingvariableindataframe.Logicalvari-ablesindataframecanbematchedtoanumericvectoroflength2andorderedwiththeTRUEtargetastherstelementandtheFALSEtargetasthesecondel-ement.Targetsforfactorsmustbelabeledtomatcheverylevelpresentinthedataframe(e.g.avariablewith2agegroups"under40"and"over40"shouldhaveelementsnamed"under40"and"over40"respectively).anesrakeattemptstoconformanyunrecognizedtypesofvectorstoclass(numeric).WeightingtargetscanbeenteredeitherasanNtobereachedorasapercentforanygivenvariable.Targetscanbeeitherproportions(ideal)orthenumberofindividualsinthepopulationineachtargetcategory(N).Totalsofgreaterthan1.5foranygivenlistelementaretreatedasNs,whilevaluesoflessthan1.5aretreatedaspercentages.dataframeThedataframecommandidentiesadata.frameobjectofthedatatobeweighted.Thedata.framemustcontainallofthevariablesthatwillbeusedintheweightingprocessandthosevariablesmusthavethesamenamesasarepresentintheinputterlistelement.caseidThecaseidcommandidentiesauniquecaseidentierforeachindividualinthedataset.Ifltersaretobeused,theresultinglistofweightswillbeadifferentlengthfromtheoveralldataframe.caseidisincludedintheoutputsothatweightscanbematchedtothedatasetofrelevance.caseidmustbeofalengthmatchingthenumberofcasesindataframe.weightvecweightvecisanoptionalinputifsomekindofbaseweights,straticationcor-rection,orothersamplingprobabilityofnotethatshouldbeaccountedforbeforeweightingisconducted.Ifdened,weightvecmustbeofalengthequivalenttothenumberofcasesinthedataframe.Ifundened,weightvecwillbeauto-maticallyseededwithavectorof1s.capcapdenesthemaximumweighttobeused.capcanbedenedbytheuserwiththecommandcap=x,wherexisanyvalueabove1atwhichthealgorithmwillcapweights.Ifcapissetbelow1,thefunctionwillreturnanerror.Ifcapissetbetween1and1.5,thefunctionwillreturnawarningthatthelowcapmaysubstantiallyincreasetheamountoftimerequiredforweighting.Intheabsenceofauser-denedcap,thealgorithmdefaultstoastartingvalueof5inlinewithDeBellandKrosnick,2009.Fornocap,capsimplyneedstobesettoanarbitrarilyhighnumber.(Note:Cappingusingthecapcommandcapsateachiteration.) 4anesrakeverboseUsersinterestedinseeingtheprogressofthealgorithmcansetverbosetoequalTRUE.Thealgorithmwilltheninformtheuseroftheprogressofeachrakingandcappingiteration.maxitUserscansetamaximumnumberofiterationsforthefunctionshoulditfailtoconvergeusingmaxit=X,whereXisthemaximumnumberofiterations.Thedefaultissetto1000.typetypeidentieswhichmannerofvariableidenticationshouldbeusedtoselectweightingvariables.Fiveoptionsareavailable:type=c("nolim","pctlim","nlim","nmin","nmax").Iftype="nolim",allvariablesspeciedininputterwillbeincludedintheweightingprocedure.Iftype="pctlim"(DEFAULT),thevariableselectional-gorithmwillassesswhichvariableshavedistributionsthatdeviatefromtheirtargetsbymorethantheamountspeciedbythepctlimcommandusingthemethodchoosemethod.Iftype="nlim",thevariableselectionalgorithmwillusethenumberofvariblesspeciedbynlim,choosingthemostdiscrepantvariablesasidentiedbythechoosemethodcommand.Iftype="nmin",thevariableselectionalgorithmwilluseatleastnlimvariables,butwillincludemoreifadditionalvariablesareoffbymorethanpctmin(allidentiedusingchoosemethod).Iftype="nmax",thevariableselectionalgorithmwillusenomorethannlimvariables,butwillonlyusethatmanyvariablesifatleastthatmanyareoffbymorethanpctlim(allidentiedusingchoosemethod).pctlimpctlimisthediscrepancylimitforselection.Variableselectionwillonlyselectvariablesthatarediscrepantbymorethantheamountspecied.pctlimcanbespeciedeitherinpercentagepoints(5is5percent)orasadecimal(.05is5percent).Thealgorithmassumesthatadecimalisbeingusedifpctlim.Henceresearchersinterestedinadiscrepancylimitofhalfapercentwouldneedtousepctlim=.005.nlimnlimisthenumberofvariablestobechosenviathevariableselectionmethodchoseninchoosemethod.filterfilterisavectorof1forcasestobeincludedinweightingand0forcasesthatshouldnotbeincluded.Thefiltervectormusthavethesamenumberofcasesasthedataframe.Intheabsenceofauser-denedfilter,thealgorithmdefaultstoastartingvalueof1(inclusion)forallindividuals.choosemethodchoosemethodisthemethodforchoosingmostdiscrepantvariables.Sixop-tionsareavailable:choosemethod=c("total","max","average","totalsquared","maxsquared","averagesquared").Ifchoosemethod="total",variablechoiceisdeterminedbythesumofthedif-ferencesbetweenactualandtargetvaluesforeachprospectiveweightingvari-able.Ifchoosemethod="max",variablechoiceisdeterminedbythelargestindi-vidualdifferencebetweenactualandtargetvaluesforeachprospectiveweight-ingvariable.Ifchoosemethod="average",variablechoiceisdeterminedbythemeanofthedifferencesbetweenactualandtargetvaluesforeachprospectiveweightingvariable.Ifchoosemethod="totalsquared",variablechoiceisde-terminedbythesumofthesquareddifferencesbetweenactualandtargetvaluesforeachprospectiveweightingvariable.Ifchoosemethod="maxsquared",vari-ablechoiceisdeterminedbythelargestsquareddifferencebetweenactualandtargetvaluesforeachprospectiveweightingvariable(notethatthisisidenticaltochoosemethod="max"iftheselectiontypeisnlim).Ifchoosemethod="averagesquared", anesrake5variablechoiceisdeterminedbythemeanofthesquareddifferencesbetweenactualandtargetvaluesforeachprospectiveweightingvariable.iterateiterateisalogicalvariableforhowrakingshouldproceediftype=c("pctlim","nmin","nmax")conditions.Ifiterate=TRUE,anesrakewillcheckwhetheranyvariablesthatwerenotusedinrakingdeviatefromtheirtargetsbymorethanpctlimpercent.Whenthisisthecase,rakingwillbererunusingtherakedweightsasseeds(weightvec)withadditionalvariblesthatmeetthisqualicationafterrakingin-cludedaswell.Forthetype="nmax"condition,thiswillonlyoccurifnlimhasnotbeenmet.convcritconvcritisthecriterionforconvergence.Therakingalgorithmisdeterminedtohaveconvergedwhenthemostrecentiterationrepresentslessthanaconvcritpercentageimprovementovertheprioriteration.force1force1ensuresthatthecategoriesofeachrakingvariablesumto1.Todoso,thetargetininputterforeachvariableisdividedbythesumofthetargetsforthatcategory.center.baseweightscenter.baseweightsforcestheinitialbaseweighttomeanto1iftrue(thedefaultsetting).ValueAlistobjectofanesrakehasthefollowingelements:weightvecVectorofweightsFromrakingalgorithmtypeTypeofvariableselectionused(identicaltospeciedtype)caseidCaseIDsfornalweights–helpfulformatchingweightvectocasesifalterisusedvarsusedListofvariablesselectedforweightingchoosemethodMethodforchoosingvariablesforweighting(identicaltospeciedchoosemethod)convergeNoteswhetherfullconvergencewasachieved,algorithmfailedtoconvergebe-causeconvergencewasnotpossible,ormaximumiterationswerereachednonconvergenceMeasureofremainingdiscrepancyfrombenchmarksifconvergencewasnotachievedtargetsinputterfromabove,alistofthetargetsusedforweightingdataframeCopyoftheoriginaldataframeusedforweighting(filtervariableappliedifspecied)iterationsNumberofiterationsrequiredforconvergence(ornon-convergence)ofnalmodeliterateCopyofiteratefromaboveAuthor(s)JoshPasek,AssistantProfessorofCommunicationStudiesattheUniversityofMichigan(www.joshpasek.com). 6anesrakenderReferencesDeBell,M.andJ.A.Krosnick.(2009).ComputingWeightsforAmericanNationalElectionStudySurveyData,ANESTechnicalReportSeries,No.nes012427.Availablefrom:ftp://ftp.electionstudies.org/ftp/nes/bibliography/documents/nes012427.pdfExamplesdata("anes04")anes04$caseid1:length(anes04$age)anes04$agecatscut(anes04$age,c(0,25,35,45,55,65,99))levels(anes04$agecats)c("age1824","age2534","age3544","age4554","age5564","age6599")marriedtargetc(.4,.6)agetargc(.10,.15,.17,.23,.22,.13)names(agetarg)c("age1824","age2534","age3544","age4554","age5564","age6599")targetslist(marriedtarget,agetarg)names(targets)c("married","agecats")outsaveanesrake(targets,anes04,caseid=anes04$caseid,verbose=TRUE)caseweightsdata.frame(cases=outsave$caseid,weights=outsave$weightvec)summary(caseweights)summary(outsave) anesrakefinderFunctiontodeterminewhatvariablesshouldbeusedforweighting. DescriptionanesraketakesalistofvariablesandtargetvaluesanddetermineswhichvariablesshouldbeusedforweightinginaccordancewithDeBellandKrosnick,2009.Usedaspartofanesrake.Usageanesrakefinder(inputter,dataframe,weightvec=NULL,choosemethod="total") anesrakender7ArgumentsinputterTheinputterobjectshouldcontainalistofalltargetvaluesfortherakingprocedure.Eachlistelementininputtershouldbeavectorcorrespondingtotheweightingtargetsforasinglevariable.Hence,thevectorenumeratingtheweightingtargetsforavariablewith2levelsshouldbeoflength2,whileavectorenumeratingtheweightingtargetsforavariablewith5levelsshouldbeoflength5.Listelementsininputtershouldbenamedaccordingtothevariablethattheywillmatchinthecorrespondingdataset.Hence,alistelementenumeratingtheproportionofthesamplethatshouldbeofeachgendershouldbelabeled"female"ifthevariableindataframeisalsotitled"female."inputterelementsmustbevectorsandcanbeofclassnumeric,orfactorandmustmatchtheclassofthecorrespondingvariableindataframe.Logicalvari-ablesindataframecanbematchedtoanumericvectoroflength2andorderedwiththeTRUEtargetastherstelementandtheFALSEtargetasthesecondel-ement.Targetsforfactorsmustbelabeledtomatcheverylevelpresentinthedataframe(e.g.avariablewith2agegroups"under40"and"over40"shouldhaveelementsnamed"under40"and"over40"respectively).anesrakeattemptstoconformanyunrecognizedtypesofvectorstoclass(numeric).WeightingtargetscanbeenteredeitherasanNtobereachedorasapercentforanygivenvariable.Targetscanbeeitherproportions(ideal)orthenumberofindividualsinthepopulationineachtargetcategory(N).Totalsofgreaterthan1.5foranygivenlistelementaretreatedasNs,whilevaluesoflessthan1.5aretreatedaspercentages.dataframeThedataframecommandidentiesadata.frameobjectofthedatatobeweighted.Thedata.framemustcontainallofthevariablesthatwillbeusedintheweightingprocessandthosevariablesmusthavethesamenamesasarepresentintheinputterlistelement.weightvecweightvecisanoptionalinputifsomekindofbaseweights,straticationcor-rection,orothersamplingprobabilityofnotethatshouldbeaccountedforbeforeweightingisconducted.Ifdened,weightvecmustbeofalengthequivalenttothenumberofcasesinthedataframe.Ifundened,weightvecwillbeauto-maticallyseededwithavectorof1s.choosemethodchoosemethodisthemethodforchoosingmostdiscrepantvariables.Sixop-tionsareavailable:choosemethod=c("total","max","average","totalsquared","maxsquared","averagesquared").Ifchoosemethod="total",variablechoiceisdeterminedbythesumofthedif-ferencesbetweenactualandtargetvaluesforeachprospectiveweightingvari-able.Ifchoosemethod="max",variablechoiceisdeterminedbythelargestindi-vidualdifferencebetweenactualandtargetvaluesforeachprospectiveweight-ingvariable.Ifchoosemethod="average",variablechoiceisdeterminedbythemeanofthedifferencesbetweenactualandtargetvaluesforeachprospectiveweightingvariable.Ifchoosemethod="totalsquared",variablechoiceisde-terminedbythesumofthesquareddifferencesbetweenactualandtargetvaluesforeachprospectiveweightingvariable.Ifchoosemethod="maxsquared",vari-ablechoiceisdeterminedbythelargestsquareddifferencebetweenactualandtargetvaluesforeachprospectiveweightingvariable(notethatthisisidenticaltochoosemethod="max"iftheselectiontypeisnlim).Ifchoosemethod="averagesquared",variablechoiceisdeterminedbythemeanofthesquareddifferencesbetween 8discrepactualandtargetvaluesforeachprospectiveweightingvariable.ValueReturnsavectorofvariablenamesanddiscrepanciesviathemethodchoseninchoosemethod.Author(s)JoshPasek,AssistantProfessorofCommunicationStudiesattheUniversityofMichigan(www.joshpasek.com). discrepFunctiontodeterminethediscrepancyforeachlevelofavariablefromtargets. DescriptionFindsthediscrepancybetweentheproportionofdataineachlevelofaweightedvectorandasetoftargetsforeachlevelofthatsamevector.Usedaspartofanesrake.Usagediscrep(datavec,targetvec,weightvec)ArgumentsdatavecVectorofvaluesforaparticularvariable.targetvecVectoroftargetswithasingleitemperlevelofthatvariable.weightvecWeightingvectortobeappliedtodatavec.ValueVectorofdiscrepanciesateachlevel.Author(s)JoshPasek,AssistantProfessorofCommunicationStudiesattheUniversityofMichigan(www.joshpasek.com). generaldesigneffect9 generaldesigneffectCalculatesageneraldesigneffectgivenweightsforadataset. DescriptionCalculatesageneraldesigneffectgivenweightsforadataset.Usagegeneraldesigneffect(weightvec)ArgumentsweightvecVectorofweights. rakelistFunctiontoperformfullANESweightingonselectedvariables. Descriptionrakelisttakesalistofvariablesandtargetvaluesweightsadatasetwiththosevariablestomatchthetargetsviaraking.Itistheprimaryworkhorsecommandofanesrake.Usagerakelist(inputter,dataframe,caseid,weightvec=NULL,cap=999999,verbose=FALSE,maxit=1000,convcrit=0.01)ArgumentsinputterTheinputterobjectshouldcontainalistofalltargetvaluesfortherakingprocedure.Eachlistelementininputtershouldbeavectorcorrespondingtotheweightingtargetsforasinglevariable.Hence,thevectorenumeratingtheweightingtargetsforavariablewith2levelsshouldbeoflength2,whileavectorenumeratingtheweightingtargetsforavariablewith5levelsshouldbeoflength5.Listelementsininputtershouldbenamedaccordingtothevariablethattheywillmatchinthecorrespondingdataset.Hence,alistelementenumeratingtheproportionofthesamplethatshouldbeofeachgendershouldbelabeled"female"ifthevariableindataframeisalsotitled"female."inputterelementsmustbevectorsandcanbeofclassnumeric,orfactorandmustmatchtheclassofthecorrespondingvariableindataframe.Logicalvari-ablesindataframecanbematchedtoanumericvectoroflength2andorderedwiththeTRUEtargetastherstelementandtheFALSEtargetasthesecondel-ement.Targetsforfactorsmustbelabeledtomatcheverylevelpresentinthedataframe(e.g.avariablewith2agegroups"under40"and"over40"should 10rakelisthaveelementsnamed"under40"and"over40"respectively).anesrakeattemptstoconformanyunrecognizedtypesofvectorstoclass(numeric).WeightingtargetscanbeenteredeitherasanNtobereachedorasapercentforanygivenvariable.Targetscanbeeitherproportions(ideal)orthenumberofindividualsinthepopulationineachtargetcategory(N).Totalsofgreaterthan1.5foranygivenlistelementaretreatedasNs,whilevaluesoflessthan1.5aretreatedaspercentages.dataframeThedataframecommandidentiesadata.frameobjectofthedatatobeweighted.Thedata.framemustcontainallofthevariablesthatwillbeusedintheweightingprocessandthosevariablesmusthavethesamenamesasarepresentintheinputterlistelement.caseidThecaseidcommandidentiesauniquecaseidentierforeachindividualinthedataset.Ifltersaretobeused,theresultinglistofweightswillbeadifferentlengthfromtheoveralldataframe.caseidisincludedintheoutputsothatweightscanbematchedtothedatasetofrelevance.caseidmustbeofalengthmatchingthenumberofcasesindataframe.weightvecweightvecisanoptionalinputifsomekindofbaseweights,straticationcor-rection,orothersamplingprobabilityofnotethatshouldbeaccountedforbeforeweightingisconducted.Ifdened,weightvecmustbeofalengthequivalenttothenumberofcasesinthedataframe.Ifundened,weightvecwillbeauto-maticallyseededwithavectorof1s.capcapdenesthemaximumweighttobeused.capcanbedenedbytheuserwiththecommandcap=x,wherexisanyvalueabove1atwhichthealgorithmwillcapweights.Ifcapissetbelow1,thefunctionwillreturnanerror.Ifcapissetbetween1and1.5,thefunctionwillreturnawarningthatthelowcapmaysubstantiallyincreasetheamountoftimerequiredforweighting.Intheabsenceofauser-denedcap,thealgorithmdefaultstoastartingvalueof5inlinewithDeBellandKrosnick,2009.Fornocap,capsimplyneedstobesettoanarbitrarilyhighnumber.(Note:Cappingusingthecapcommandcapsateachiteration.)verboseUsersinterestedinseeingtheprogressofthealgorithmcansetverbosetoequalTRUE.Thealgorithmwilltheninformtheuseroftheprogressofeachrakingandcappingiteration.maxitUserscansetamaximumnumberofiterationsforthefunctionshoulditfailtoconvergeusingmaxit=X,whereXisthemaximumnumberofiterations.Thedefaultissetto1000.convcritconvcritisthecriterionforconvergence.Therakingalgorithmisdeterminedtohaveconvergedwhenthemostrecentiterationrepresentslessthanaconvcritpercentageimprovementovertheprioriteration.ValueAlistobjectofrakelisthasthefollowingelements:weightvecVectorofweightsFromrakingalgorithmcaseidCaseIDsfornalweights–helpfulformatchingweightvectocasesifalterisused weightassess11iterationsNumberofiterationsrequiredforconvergence(ornon-convergence)ofnalmodelnonconvergenceMeasureofremainingdiscrepancyfrombenchmarksifconvergencewasnotachievedconvergeNoteswhetherfullconvergencewasachieved,algorithmfailedtoconvergebe-causeconvergencewasnotpossible,ormaximumiterationswerereachedvarsusedListofvariablesselectedforweightingtargetsinputterfromabove,alistofthetargetsusedforweightingdataframeCopyoftheoriginaldataframeusedforweighting(filtervariableappliedifspecied)Author(s)JoshPasek,AssistantProfessorofCommunicationStudiesattheUniversityofMichigan(www.joshpasek.com). weightassessAssessmentofWeighting DescriptionShowsweighteddataonspeciedvariablescomparedtotargetsandbaseweights.Usageweightassess(inputter,dataframe,weightvec,prevec=NULL)ArgumentsinputterTheinputterobjectshouldcontainalistofalltargetvaluesfortherakingprocedure.Eachlistelementininputtershouldbeavectorcorrespondingtotheweightingtargetsforasinglevariable.Hence,thevectorenumeratingtheweightingtargetsforavariablewith2levelsshouldbeoflength2,whileavectorenumeratingtheweightingtargetsforavariablewith5levelsshouldbeoflength5.Listelementsininputtershouldbenamedaccordingtothevariablethattheywillmatchinthecorrespondingdataset.Hence,alistelementenumeratingtheproportionofthesamplethatshouldbeofeachgendershouldbelabeled"female"ifthevariableindataframeisalsotitled"female."inputterelementsmustbevectorsandcanbeofclassnumeric,orfactorandmustmatchtheclassofthecorrespondingvariableindataframe.Logicalvari-ablesindataframecanbematchedtoanumericvectoroflength2andorderedwiththeTRUEtargetastherstelementandtheFALSEtargetasthesecondel-ement.Targetsforfactorsmustbelabeledtomatcheverylevelpresentinthedataframe(e.g.avariablewith2agegroups"under40"and"over40"shouldhaveelementsnamed"under40"and"over40"respectively).anesrakeattemptstoconformanyunrecognizedtypesofvectorstoclass(numeric).WeightingtargetscanbeenteredeitherasanNtobereachedorasapercentforanygiven 12weightassessvariable.Targetscanbeeitherproportions(ideal)orthenumberofindividualsinthepopulationineachtargetcategory(N).Totalsofgreaterthan1.5foranygivenlistelementaretreatedasNs,whilevaluesoflessthan1.5aretreatedaspercentages.dataframeThedataframecommandidentiesadata.frameobjectofthedatatobeweighted.Thedata.framemustcontainallofthevariablesthatwillbeusedintheweightingprocessandthosevariablesmusthavethesamenamesasarepresentintheinputterlistelement.weightvecweightvecisavectorofnalweightsthataretobeassessed.prevecprevecisanoptionalinputifsomekindofbaseweights,straticationcorrec-tion,orothersamplingprobabilityofnotethatshouldbeaccountedforbeforeweightingisconducted.Ifdened,prevecmustbeofalengthequivalenttothenumberofcasesinthedataframe.Ifundened,prevecwillbeautomaticallyseededwithavectorof1s.ValuePrintsoutalistofalllevelsofallvariablesnamedininputter.Foreachvariable,showsvaluesweightedwithprevec,weightvec,andthetargetsandassessesdiscrepanciesforeach.Author(s)JoshPasek,AssistantProfessorofCommunicationStudiesattheUniversityofMichigan(www.joshpasek.com). IndexTopic\textasciitilderakinganesrake,2rakelist,9Topic\textasciitildevariableselectionanesrake,2anesrakefinder,6Topic\textasciitildeweightsanesrake,2rakelist,9Topicdatasetsanes04,2anes04,2anesrake,2anesrakefinder,6discrep,8generaldesigneffect,9print.anesrake(anesrake),2print.anesrakelist(rakelist),9rakelist,9rakeonvar(rakelist),9selecthighestpcts(anesrakefinder),6selectnhighest(anesrakefinder),6summary.anesrake(anesrake),2summary.anesrakelist(rakelist),9weightassess,1113

Related Contents


Next Show more