/*! For license information please see dll.211.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[211],{2077:function(e,t,a){"use strict";a.r(t);var n=a(137),l=a.n(n),r=a(983),o=a.n(r);t.default=function(e,t){for(var a=[],n=0;n<e.length;n++){var r=t[e[n]];if(r)for(var i=new Set,u=0;u<r.length;u++){var s=r[u];if(o()(s)||l()(s)||""===s||i.add(s),i.size>2)break;u===r.length-1&&a.push(e[n])}}return a}},3441:function(e,t,a){"use strict";a.r(t);var n=a(14),l=a.n(n),r=a(12),o=a.n(r),i=a(10),u=a.n(i),s=a(15),c=a.n(s),d=a(16),f=a.n(d),p=a(8),m=a.n(p),h=a(7),g=a.n(h),y=a(0),v=a.n(y),E=a(1),S=a.n(E),w=a(75),T=a(86),b=a(66),x=a(965),C=a(204),D=a(203),R=a(362),V=a(1825),A=a(200),_=a(991),P=a(2077);function k(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=m()(e);if(t){var l=m()(this).constructor;a=Reflect.construct(n,arguments,l)}else a=n.apply(this,arguments);return f()(this,a)}}var q=function(e){c()(a,e);var t=k(a);function a(e){var n;return l()(this,a),n=t.call(this,e),g()(u()(n),"calculateTwoSampleZTest",(function(){var e=n.state,t=e.x,a=e.group,l=e.y,r=e.diff,o=e.direction,i=e.alpha,u=e.type,s=e.xstdev,c=e.ystdev,d=n.props,f=d.data,p=d.showDecision;if(!l&&!a)return 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 m=v.a.createElement(V.default,{x:t,group:a,y:l,diff:r,direction:o,alpha:i,type:u,xstdev:s,ystdev:c,data:f,showDecision:p});n.props.logAction(A.DATA_EXPLORER_TESTS_TWO_SAMPLE_MEAN,{x:t,group:a,y:l,diff:r,direction:o,alpha:i,showDecision:p}),n.props.onCreated(m)})),n.state={x:null,group:null,y:null,diff:0,direction:"two-sided",alpha:.05,type:"T Test",xstdev:null,ystdev:null},n}return o()(a,[{key:"renderInputs",value:function(){var e=this,t=this.props,a=t.quantitative,n=t.categorical,l=t.data,r=Object(P.default)(n,l);return v.a.createElement(y.Fragment,null,v.a.createElement(D.default,{legend:"Type of Test:",defaultValue:this.state.type,options:["T Test","Z Test"],onChange:function(t){e.setState({type:t})}}),v.a.createElement(D.default,{legend:"Variable:",defaultValue:this.state.x,options:a,onChange:function(t){e.setState({x:t})}}),v.a.createElement(x.default,null,v.a.createElement(b.default,{md:5},v.a.createElement(D.default,{legend:"Groups:",options:r,defaultValue:this.state.group,clearable:!0,onChange:function(t){return e.setState({y:null,group:t})}})),v.a.createElement(b.default,{md:2},v.a.createElement("p",null,"OR")),v.a.createElement(b.default,{md:5},v.a.createElement(D.default,{legend:"Second Variable:",options:a,defaultValue:this.state.y,clearable:!0,onChange:function(t){return e.setState({y:t,group:null})}}))),"Z Test"===this.state.type?v.a.createElement(x.default,null,v.a.createElement(b.default,null,v.a.createElement(C.default,{legend:"1st Standard Deviation",defaultValue:this.state.xstdev||1,step:"any",min:0,onChange:function(t){e.setState({xstdev:t})}})),v.a.createElement(b.default,null,v.a.createElement(C.default,{legend:"2nd Standard Deviation",defaultValue:this.state.ystdev||1,step:"any",min:0,onChange:function(t){e.setState({ystdev:t})},tooltipPlacement:"top"}))):null,v.a.createElement(x.default,null,v.a.createElement(b.default,null,v.a.createElement(C.default,{legend:"Difference under H0",defaultValue:this.state.diff,step:"any",onChange:function(t){e.setState({diff:t})}})),v.a.createElement(b.default,null,v.a.createElement(C.default,{legend:v.a.createElement("span",null,"Significance level ",v.a.createElement(R.default,{raw:"\\alpha"})),defaultValue:this.state.alpha,min:0,max:1,step:"any",onChange:function(t){e.setState({alpha:t})},tooltipPlacement:"bottom"}))),v.a.createElement(D.default,{legend:"Direction:",defaultValue:this.state.direction,options:["less","greater","two-sided"],onChange:function(t){e.setState({direction:t})},menuPlacement:"top"}))}},{key:"render",value:function(){return v.a.createElement(T.default,{style:{fontSize:"14px"}},v.a.createElement(T.default.Header,{as:"h4"},"Two-Sample Mean Test",v.a.createElement(_.default,{title:"Two-Sample Mean Test",content:"A test for equality of means across two groups."})),v.a.createElement(T.default.Body,null,this.renderInputs(),v.a.createElement(w.default,{variant:"primary",block:!0,onClick:this.calculateTwoSampleZTest,disabled:!this.state.group&&!this.state.y||!this.state.x},"Calculate")))}}]),a}(y.Component);q.defaultProps={categorical:null,logAction:function(){},session:{},showDecision:!0},q.propTypes={categorical:S.a.array,quantitative:S.a.array.isRequired,data:S.a.object.isRequired,logAction:S.a.func,onCreated:S.a.func.isRequired,session:S.a.object,showDecision:S.a.bool},t.default=q}}]);