J-PAL / bcstatsR

R version of the Stata command bcstats
MIT License
7 stars 6 forks source link

can't find `ttest` element referenced in example code #9

Closed jamesdunham closed 7 years ago

jamesdunham commented 7 years ago

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!

jamesdunham commented 7 years ago

Ah, it only exists when the ttest argument is used.