Shared Scripts, Data, Stimuli, Files, and Demos

Basic statistics Run Experiment

Basic statistics

Apple

This demo includes basic statistical analysis of Nielsen Ratings for Favourite Syndicated Programs from 1992-93, including minimum, maximum, range, count, sum, mean, median, variance, standard deviation, standard error and one-tailed non-paired T test.

No comments yet
 




Comments

No comments yet

If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.

It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.

The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.

 
// Two-sample T-test (one-taied, non-paired)
stat.ttest_ext = function(a,b)
{
              // Use unbiased estimator of the variance
    var v_a = stat.variance(a,true), v_b = stat.variance(b,true),
        n_a = stat.count(a), n_b = stat.count(b),
        T = Math.abs((stat.mean(a) - stat.mean(b))/Math.sqrt(v_a/n_a + v_b/n_b)),
        df = Math.pow(v_a/n_a + v_b/n_b,2) /
             (Math.pow(v_a/n_a,2)/(n_a - 1) + Math.pow(v_b/n_b,2)/(n_b - 1));
        
    return {p: tdist(T,df), T: T};
}


//Nielsen Ratings for Favorite Syndicated Programs from 1992-93 
var women,men,teenager,children,all = [];
women = [11.8,9.9,7.1,6.5,8.4,6.4,4.9,4.1,6.3,5.1,5.6,4.8,4.4,4.2,4.1,4.4,3.7,4.3,3.3,2.5];
men = [8.0,6.9,9.2,8.2,3.4,5.0,4.7,4.5,4.5,4.2,4.0,4.7,4.1,4.2,3.2,3.1,4.9,2.7,4.6,4.0];
teenager = [3.3,3.0,6.4,5.8,2.7,2.1,4.6,6.8,1.7,2.3,1.8,3.1,3.4,4.0,4.6,5.8,3.4,3.4,2.1,5.2];
children = [3.4,2.3,5.1,4.8,1.7,1.9,5.8,4.7,1.6,1.8,1.6,2.9,3.8,3.4,7.4,4.3,3.2,2.2,2.2,5.6];
all = all.concat(women,men,teenager,children);

//Return the minimal rating by women
text("The minimum rating by women is " + stat.min (women));
await(5000);

//Return the maximal rating by men
text("The maximun rating by men is " + stat.max (women));
await(5000);

//Return the rating range by teenagers
text("The range of rating by teenagers is " + stat.range(teenager));
await(5000);

//Return the count of rating by children
text("The count of rating by children is " + stat.count(children));
await(5000);

//Return the sum of all ratings
text("The sum of all ratings is " + stat.sum(all).toFixed(2));
await(5000);

//Return the mean value of all ratings
text("The mean of all ratings is " + stat.mean(all).toFixed(2));
await(5000);

//Return the median value of all ratings
text("The median of all ratings is " + stat.median(all));
await(5000);

//Return the variance of all ratings
text("The variance of all ratings is " + stat.variance(all).toFixed(2));
await(5000);

//Return the standard deviation of all ratings
text("The standard deviation of all ratings is " + stat.stddev(all).toFixed(2));
await(5000);

//Return the standard error of all ratings
text("The standard error of all ratings is " + stat.stderr(all).toFixed(2));
await(5000);

//between subject t-test (one-taied, non-paired)
ttest = stat.ttest_ext(women,men);
text("The result of a between subject t-test (one-taied, non-paired) on ratings by women and men 
" + "t = " + ttest.T.toFixed(2) + " p = " + ttest.p.toFixed(3)); await(5000);

Data inspection is forthcoming!

In the mean time, authors may download their own data and make it available as an Excel file. Check out the 'Stimuli and Files' tab.

Click on a category to view the stimuli and files

Related Experiments