Skip to content

Commit e8b3b87

Browse files
author
minjk-bl
committed
Fix students t-test two-sample code
1 parent 2b41efa commit e8b3b87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

visualpython/js/m_stats/StudentstTest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ define([
275275
code.appendLine("# Independent two-sample t-test");
276276
// variable declaration
277277
if (inputType === 'long-data') {
278-
code.appendFormatLine("vp_df1 = df[(df[{0}] == '{1}')][{2}].dropna().copy()", groupingVariable, group1, testVariable);
279-
code.appendFormatLine("vp_df2 = df[(df[{0}] == '{1}')][{2}].dropna().copy()", groupingVariable, group2, testVariable);
278+
code.appendFormatLine("vp_df1 = {0}[({1}[{2}] == '{3}')][{4}].dropna().copy()", data, data, groupingVariable, group1, testVariable);
279+
code.appendFormatLine("vp_df2 = {0}[({1}[{2}] == '{3}')][{4}].dropna().copy()", data, data, groupingVariable, group2, testVariable);
280280
} else if (inputType === 'wide-data') {
281-
code.appendFormatLine("vp_df1 = df[{0}].dropna().copy()", testVariable1);
282-
code.appendFormatLine("vp_df2 = df[{0}].dropna().copy()", testVariable2);
281+
code.appendFormatLine("vp_df1 = {0}[{1}].dropna().copy()", data, testVariable1);
282+
code.appendFormatLine("vp_df2 = {0}[{1}].dropna().copy()", data, testVariable2);
283283
}
284284
code.appendLine("");
285285
// 1. Normality test

0 commit comments

Comments
 (0)