j-pal / bcstatsr Goto Github PK
View Code? Open in Web Editor NEWR version of the Stata command bcstats
License: MIT License
R version of the Stata command bcstats
License: MIT License
Consider the following cases of missing data
Each one of these cases will return a NA
when evaluated instead of a TRUE
or FALSE
.
Create a bcstats S3 or S4 object that users can invoke summary to get a well formated list of results.
Hi, I'm stepping through the example code and don't see a ttest
element in the list of results.
library(bcstatsR)
data(survey)
data(bc)
result <- bcstats(surveydata = survey,
bcdata = bc,
id = "id",
t1vars = "gender",
t2vars = "gameresult",
t3vars = "itemssold",
enumerator = "enum",
enumteam = "enumteam",
backchecker = "bcer")
result[["ttest"]]
# NULL
str(result, 1)
# List of 7
# $ backcheck :'data.frame': 26 obs. of 8 variables:
# $ enum1 :List of 2
# $ enum2 :List of 2
# $ enumteam1 :List of 2
# $ enumteam2 :List of 2
# $ backchecker1:List of 2
# $ backchecker2:List of 2
# NULL
m stepping through the example code and don't see a 'ttest' element in the list of results.
library(bcstatsR)
data(survey)
data(bc)
result <- bcstats(surveydata = survey,
bcdata = bc,
id = "id",
t1vars = "gender",
t2vars = "gameresult",
t3vars = "itemssold",
enumerator = "enum",
enumteam = "enumteam",
backchecker = "bcer")
result[["ttest"]]
# NULL
I'm not sure what precisely the expected output is -- I haven't looked into the code yet.
My result object looks like:
str(result, 1)
# List of 7
# $ backcheck :'data.frame': 26 obs. of 8 variables:
# $ enum1 :List of 2
# $ enum2 :List of 2
# $ enumteam1 :List of 2
# $ enumteam2 :List of 2
# $ backchecker1:List of 2
# $ backchecker2:List of 2
# NULL
Thanks!
Seems like ghit is a lighter way for users to install R packages from Github as opposed to devtools, which includes several more dependencies for developing R packages.
How should factors be handled? For example, if the survey data uses different factors for a variable than the back check, then the comparison will be messed up. Should they just be coerced to a string?
Need to add Type 3 variables to backcheck
results. Consider moving
# Type 3 variables do not have errors
pairwise$error[pairwise$type == "Type 3"] <- FALSE
to after storing the back check and proceeding to error rate reporting.
It'd be nice to add a graphical interface using Shiny Gadgets.
Handle cases where there are no differences between the survey and the back check.
Returns different results than Stata (probably not using the same test as Stata).
Please see the following error
# Load bcstatsR
> library(bcstatsR)
>
> # Load a toy example bundled with bcstatsR
> data(survey, bc)
>
> # Compare the differences with bcstats
> compute.bc <- bcstats(surveydata = survey,
+ bcdata = bc,
+ id = "id",
+ t1vars = "gender",
+ t2vars = "gameresult",
+ t3vars = "itemssold",
+ enumerator = "enum",
+ ttest = "itemssold")
Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column
>
> print(compute.bc$backcheck)
Error in print(compute.bc$backcheck) : object 'compute.bc' not found
>
@vikjam
Is there a way to add multiple Type 1/2/3 variables? In the examples I only see 1 variable for each, and I'm not sure what other type of object "t1vars" would take than individual variable names.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.