<!DOCTYPE rkplugin>
<!-- TODO: This plugin should really be split up. It is overly complex. -->
<document>
	<code file="code.php"/>
	<logic>
		<connect client="constMad.enabled" governor="mad.state" />
		<connect client="pourcent.enabled" governor="trim.state" />
		<connect client="winsor.enabled" governor="huber.state" />

		<connect client="customMu.enabled" governor="huber.state" />
		<convert id="mubox" mode="and" sources="customMu.state;customMu.enabled" />
		<connect client="mu.enabled" governor="mubox" />

		<connect client="customS.enabled" governor="huber.state" />
		<convert id="sbox" mode="and" sources="customS.state;customS.enabled" />
		<connect client="s.enabled" governor="sbox" />

		<connect client="tol.enabled" governor="huber.state" />
		<connect client="initmu.enabled" governor="huber.state" />
		<connect client="nom.enabled" governor="result.state" />
	</logic>
	<dialog label="Basic statistics" >
		<tabbook>
			<tab label="Select variables" >
				<column>
					<row>
						<varselector id="vars" />
						<varslot multi="true" classes="numeric integer" id="z" source="vars" label="Variable" required="true" />
					</row>
				</column>
			</tab>
			<tab label="Statistics" >
				<frame label="General" >
					<row>
						<checkbox value_unchecked="0" checked="false" value="1" id="length" label="Length and NAs" />
					</row>
				</frame>
				<frame label="Moments" >
					<row>
						<checkbox value_unchecked="0" checked="false" value="1" id="mean" label="Mean" />
						<checkbox value_unchecked="0" checked="false" value="1" id="vari" label="Variance" />
						<checkbox value_unchecked="0" checked="false" value="1" id="sd" label="Sd" />
					</row>
				</frame>
				<frame label="extrema" >
					<row>
						<column>
							<checkbox value_unchecked="0" checked="false" value="1" id="minimum" label="Minimum" />
							<checkbox value_unchecked="0" checked="false" value="1" id="maximum" label="Maximum" />
						</column>
						<column>
							<spinbox type="integer" id="nbminimum" min="0" initial="0" max="100" label="Number of minimum values displayed" />
							<spinbox type="integer" id="nbmaximum" min="0" initial="0" max="100" label="Number of maximum values displayed" />
						</column>
					</row>
				</frame>
				<frame label="Quantile" >
					<row>
						<checkbox value_unchecked="0" checked="false" value="1" id="median" label="Median" />
						<checkbox value_unchecked="0" checked="false" value="1" id="irq" label="Interquartile Range" />
						<checkbox value_unchecked="0" checked="false" value="1" id="quartile" label="Quartile" />
					</row>
					<row>
						<spinbox type="integer" id="autre" min="0" initial="0" max="100" label="Other (eg : for deciles, enter 10)" />
					</row>
				</frame>
			</tab>
			<tab label="Robust statistics" >
				<column>
					<frame label="Dispersion" >
						<row>
							<checkbox checked="false" value="1" id="mad" label="Median Absolute Deviation" />
							<spinbox type="real" initial="1.4628" id="constMad" label="Constant" />
						</row>
					</frame>
					<frame label="Robust mean" >
						<row>
							<checkbox checked="false" value="1" id="trim" label="Trimmed Mean" />
							<spinbox min="0" id="pourcent" initial="0.05" max="0.5" label="Percentage of trimmed values" />
						</row>
					</frame>
					<frame label="M-Estimator" >
						<row>
							<checkbox checked="false" value="1" id="huber" label="Huber -M estimator (Require MASS Library)" />
							<spinbox min="0" id="winsor" initial="1.5" max="10" label="Winsorize at 'k' sd" />
						</row>
						<row>
							<column>
								<checkbox checked="false" value="1" id="customMu" label="Custom Mu value" />
								<input size="small" id="mu" label="Enter your value" />
							</column>
							<column>
								<checkbox checked="false" value="1" id="customS" label="Custom s value" />
								<input size="small" id="s" label="S value" />
							</column>
						</row>
						<row>
							<column>
								<spinbox type="real" intial="1e-6" max_precision="6" min="0" max="1" id="tol" label="Tolerance" />
							</column>
							<column>
								<radio id="initmu" label="Initial value" >
									<option value="median" label="Median" />
									<option value="mean" label="Mean" />
								</radio>
							</column>
						</row>
					</frame>
				</column>
			</tab>
			<tab id="option" label="Options" >
				<checkbox value_unchecked="0" checked="true" value="1" id="narm" label="Omit missing values" />
				<checkbox checked="false" value="1" id="result" label="Store results" />
				<saveobject intial="rk.univariate" id="nom" label="Name of the result" />
				<stretch/>
			</tab>
		</tabbook>
	</dialog>
</document>
