Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoopy1866 committed Sep 16, 2024
1 parent b8326c6 commit fed10ef
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 296 deletions.
65 changes: 11 additions & 54 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,60 +1,17 @@
import pprint
from pystatpower.procedures.two_proportion import *

result = (
TwoProportion(EnumSolvableParameter.N)
.set_alpha(0.05)
.set_power(0.8)
.set_alternative(EnumAlternative.TWO_SIDED)
.set_group_allocation(GroupAllocation(EnumGroupAllocation.EQUAL))
.set_test_type(EnumTestType.Z_TEST_POOLED)
.set_treatment_proportion(0.95)
.set_reference_proportion(0.80)
.get_solver()
.solve()
)

print(result)


result = (
TwoProportion(EnumSolvableParameter.N)
.set_alpha(0.05)
.set_power(0.8)
.set_alternative(EnumAlternative.TWO_SIDED)
.set_group_allocation(GroupAllocation(EnumGroupAllocation.FIX_TREATMENT_GROUP).set_treatment_n(100))
.set_test_type(EnumTestType.Z_TEST_POOLED)
.set_treatment_proportion(0.95)
.set_reference_proportion(0.80)
.get_solver()
.solve()
)

print(result)


result = (
TwoProportion(EnumSolvableParameter.N)
.set_alpha(0.05)
.set_power(0.8)
.set_alternative(EnumAlternative.TWO_SIDED)
.set_group_allocation(GroupAllocation(EnumGroupAllocation.EQUAL))
.set_test_type(EnumTestType.Z_TEST_POOLED)
.set_treatment_proportion(0.68)
.set_reference_proportion(0.69)
.get_solver()
.solve()
)

print(result)


result = fun_power(
model = TwoProportionSolveForSize(
alpha=0.05,
treatment_n=10000,
reference_n=10000,
treatment_proportion=0.68,
reference_proportion=0.69,
power=0.80,
treatment_proportion=0.95,
reference_proportion=0.80,
alternative=EnumAlternative.TWO_SIDED,
test_type=EnumTestType.Z_TEST_POOLED,
group_allocation=TwoProportionSolveForSizeGroupAllocator(),
)
print(result)

model.solve()


pprint.pprint(model)
Loading

0 comments on commit fed10ef

Please sign in to comment.