############################################################ # # # Virtual Laboratory of Geomathematics in Python # # # # Enumerative Data Models (18.08.2017) # # # # VLG Team, Complutense University of Madrid, Spain # # # # THIS SCRIPT IS PROVIDED BY THE AUTHORS "AS IS" AND # # CAN BE USED BY ANYONE FOR THE PURPOSES OF EDUCATION # # AND RESEARCH. # # # ############################################################ from statsmodels.stats.proportion import proportions_ztest # Example. Granulometric analysis of soil, Is the soil suitable for agriculture? # ONE PROPORTION x = 15 n = 42 H0 = 0.45 # alternative : string in [‘two-sided’, ‘smaller’, ‘larger’] HA = 'smaller' z,p = proportions_ztest(x, n, H0, HA) print() print(' z-stat. one proportion = {z} \n p-value = {p}'.format(z=z,p=p)) print()