Pivot Table and Table Demo Experiment Run Experiment

Pivot Table and Table

Jaap Murre

Demo of the pivottable function and how present tables (e.g., for feedback)


The exec.pivottable() function is documented in the Leanpub book.

The table functions are not documented because they are still under development. Use at your own risk: They may change substantially and without prior notice in the near future.

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.

var arr = [{x:1,y:2},{x:1,y:4},{x:2,y:3},{x:2,y:6}],

    // Collapse mean and SD over x values 1 and 2
    pt = exec.pivottable(arr,"x","y",
        {
            "Average": stat.mean,
            "SD": stat.stddev
        });
    
main.setfontsize(80); // Set font size to 80%
main.centerblock.table(pt,"x",["Average","SD"]); // Place at center Block

await(5000);
text("Different style (Minimalist B, with Minimalist A as default) and with a title");
await(2000);

// Define some options with styles translating to a CSS class
options = {
    title: "Demo Table",
    style: "minimalist-b"
}

main.centerblock.table(pt,"x",["Average","SD"],options);

await(5000);
text("Box style A");
await(2000);

options.style = "box-a";
main.centerblock.table(pt,"x",["Average","SD"],options);

await(5000);
text("Box style B");
await(2000);

options.style = "box-b";
main.centerblock.table(pt,"x",["Average","SD"],options);


await(5000);
This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type