Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iebaltab: Add SETtest option #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/ado_files/iebaltab.ado
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
NOTtest ///
NORMDiff ///
PTtest ///
SETtest ///
PFtest ///
FEQTest ///
PBoth ///
Expand Down Expand Up @@ -217,6 +218,10 @@ qui {
*Is option pttest() used:
if "`pttest'" == "" local PTTEST_USED = 0
if "`pttest'" != "" local PTTEST_USED = 1

*Is option settest() used:
if "`settest'" == "" local SETTEST_USED = 0
if "`settest'" != "" local SETTEST_USED = 1

*Is option pftest() used:
if "`pftest'" == "" local PFTEST_USED = 0
Expand Down Expand Up @@ -518,6 +523,13 @@ qui {
noi display as error "{phang}Option totallabel() may only be used together with the option total"
error 197
}

if `SETTEST_USED' & `PTTEST_USED' {

*Error for settest() and pttest() incorrectly applied together
noi display as error "{phang}Option settest may not be used in combination with the option pttest"
error 197
}


** Stats Options
Expand Down Expand Up @@ -1808,6 +1820,12 @@ qui {
*Perform the t-test and store p-value in pttest
test `tempvar_thisGroupInPair'
local pttest = r(p)

if `SETTEST_USED' {
local diffse = _se[`tempvar_thisGroupInPair']
local diffse : display `diformat' `diffse'
local diffse = trim("`diffse'")
}


*If p-test option is used
Expand All @@ -1834,8 +1852,9 @@ qui {
local tableRowUp `" `tableRowUp' _tab "`ttest_output'" "'
local tableRowDo `" `tableRowDo' _tab " " "'

local texRow `" `texRow' " & `ttest_output'" "'
}
if `PTTEST_USED' | !`SETTEST_USED' local texRow `" `texRow' " & `ttest_output'" "'
else local texRow `" `texRow' " & \begin{tabular}[t]{@{}c@{}} `ttest_output' \\ (`diffse') \end{tabular}" "'
}
}
}

Expand Down