/*! For license information please see dll.212.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[212],{2077:function(e,t,a){"use strict";a.r(t);var n=a(137),r=a.n(n),o=a(983),l=a.n(o);t.default=function(e,t){for(var a=[],n=0;n<e.length;n++){var o=t[e[n]];if(o)for(var i=new Set,s=0;s<o.length;s++){var c=o[s];if(l()(c)||r()(c)||""===c||i.add(c),i.size>2)break;s===o.length-1&&a.push(e[n])}}return a}},3443:function(e,t,a){"use strict";a.r(t);var n=a(14),r=a.n(n),o=a(12),l=a.n(o),i=a(10),s=a.n(i),c=a(15),u=a.n(c),f=a(16),d=a.n(f),p=a(8),g=a.n(p),h=a(7),m=a.n(h),v=a(0),E=a.n(v),w=a(1),b=a.n(w),S=a(75),y=a(86),T=a(66),C=a(965),P=a(204),R=a(203),D=a(362),A=a(201),_=a.n(A),k=a(39),q=a.n(k),O=a(1100),V=a.n(O),j=a(1829),x=a(1217),z=a(200),H=a(991),J=a(2077);function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,n=g()(e);if(t){var r=g()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return d()(this,a)}}var N=function(e){u()(a,e);var t=L(a);function a(e){var n;r()(this,a),n=t.call(this,e),m()(s()(n),"calculateTwoSamplePropTest",(function(){var e=n.state,t=e.var1,a=e.success,r=e.group,o=e.var2,l=e.diff,i=e.direction,s=e.alpha,c=n.props,u=c.data,f=c.showDecision;if(t===r||t===o)return n.props.session.addNotification({title:"Action required",message:"Please make sure that the group variable or second variable is not equal to your variable of interest.",level:"warning",position:"tr"});r||o||n.props.session.addNotification({title:"Action required",message:"Please select either a grouping variable or a second variable to compare ".concat(t," against."),level:"warning",position:"tr"});var d=E.a.createElement(j.default,{data:u,showDecision:f,var1:t,var2:o,group:r,diff:l,direction:i,alpha:s,success:a});n.props.logAction(z.DATA_EXPLORER_TESTS_TWO_SAMPLE_PROPTEST,{var1:t,group:r,var2:o,success:a,diff:l,direction:i,alpha:s,showDecision:f}),n.props.onCreated(d)}));var o,l=e.categorical[0];if(q()(e.categorical)&&e.categorical.length>0){var i=e.data[l];o=i?Object(x.default)(i,l):[]}else o=[];return n.state={categories:o,var1:l,success:o[0],group:null,var2:null,diff:0,direction:"two-sided",alpha:.05},n}return l()(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.categorical,n=t.data,r=Object(J.default)(a,n);return E.a.createElement(y.default,{style:{fontSize:"14px"}},E.a.createElement(y.default.Header,{as:"h4"},"Two-Sample Proportion Test",E.a.createElement(H.default,{title:"Two-Sample Proportion Test",content:"A test for equality of proportions for a selected category of a qualitative variable across two groups."})),E.a.createElement(y.default.Body,null,E.a.createElement(C.default,null,E.a.createElement(T.default,{md:6},E.a.createElement(R.default,{legend:"Variable:",defaultValue:a[0],options:a,onChange:function(t){var a=e.props.data[t],n=Object(x.default)(a,t);V()(n),e.setState({var1:t,categories:n,success:n[0]})}})),E.a.createElement(T.default,{md:6},E.a.createElement(R.default,{legend:"Success:",defaultValue:this.state.categories[0],options:this.state.categories,onChange:function(t){e.setState({success:t})}}))),E.a.createElement(C.default,null,E.a.createElement(T.default,{md:5},E.a.createElement(R.default,{legend:"Groups:",options:r,clearable:!0,onChange:function(t){e.setState({group:t,var2:null})}})),E.a.createElement(T.default,{md:2},E.a.createElement("p",null,"OR")),E.a.createElement(T.default,{md:5},E.a.createElement(R.default,{legend:"Second Variable: ",options:a.filter((function(t){return _()(e.state.categories,t)})),clearable:!0,onChange:function(t){e.setState({group:null,var2:t})}}))),E.a.createElement(P.default,{legend:"Difference under H0",defaultValue:this.state.diff,min:0,max:1,step:"any",onChange:function(t){e.setState({diff:t})}}),E.a.createElement(R.default,{legend:"Direction:",defaultValue:this.state.direction,options:["less","greater","two-sided"],onChange:function(t){e.setState({direction:t})}}),E.a.createElement(P.default,{legend:E.a.createElement("span",null,"Significance level ",E.a.createElement(D.default,{raw:"\\alpha"})),defaultValue:this.state.alpha,min:0,max:1,step:"any",onChange:function(t){e.setState({alpha:t})}}),E.a.createElement(S.default,{variant:"primary",block:!0,onClick:this.calculateTwoSamplePropTest,disabled:!this.state.var2&&!this.state.group},"Calculate")))}}]),a}(v.Component);N.propTypes={categorical:b.a.array,data:b.a.object.isRequired,logAction:b.a.func,onCreated:b.a.func.isRequired,session:b.a.object,showDecision:b.a.bool},N.defaultProps={categorical:null,logAction:function(){},session:{},showDecision:!0},t.default=N}}]);