// Javascript rewrite of // http://statistics.berkeley.edu/~stark/Java/Html/Ci.htm // // Authors: James Eady // Philip B. Stark // // container_id: the CSS ID of the container to create the histogram (and // controls) in. // params: A javascript object with various parameters to customize the chart. function Stici_Ci(container_id, params) { var self = this; // jQuery object containing the entire chart. var container = jQuery('#' + container_id); // These are constants. var maxSamples = 1000; // max number of samples var maxSampleSize = 250; // max sample size var nDigs = 4; // number of digits in numbers in box var defaultPopSize = 10; var rSE = { "True SE": "true se", "Estimated SE": "estimated se", "Bound on SE (0-1 box only)": "bound on se (0-1 box only)" }; var rSource = { "Normal": "normal", "Uniform": "uniform", "Box": "box", "0-1 Box": "0-1 box" }; // User-configurable parameters. These are directly lifted from // Ci.java. var options = { factor: 1, showTruth: true, toggleTruth: true, editBox: true, replaceControl: false, replace: true, sampleSize: 2, sources: "all", seChoices: "all", useSe: null, boxContents: "0,1,2,3,4" }; jQuery.extend(options, params); // UI Elements. var sampleSizeBar = null; // SticiTextBar var samplesToTakeBar = null; // SticiTextBar var facBar = null; // SticiTextBar var takeSampleButton = null; var hideBoxButton = null; // SticiToggleButton var sourceChoice = null; // SticiComboBox var seChoice = null; // SticiComboBox var box = null; //