Displaying 2 results from an estimated 2 matches for "head_ct".
2010 Oct 13
2
Coin Toss Simulation
...n coss simulation, of say 200 coin tosses. The idea
is to have a data frame like so:
Experiment# Number_Of_Heads
1 104
2 96
3 101
So I do:
d <-data.frame(exp_num=c(1,2,3)); /* Just 3 experiments to begin with */
d$head_ct <-sum(sample(0:1,200,repl=TRUE));
d;
exp_num head_ct
1 1 85
2 2 85
3 3 85 /* the same scalar value is
applied to all the rows */
So I tried using "within", and "for", and making the "sum( "...
2010 Oct 15
0
nomianl response model
...n coss simulation, of say 200 coin tosses. The idea
is to have a data frame like so:
Experiment# Number_Of_Heads
1 104
2 96
3 101
So I do:
d <-data.frame(exp_num=c(1,2,3)); /* Just 3 experiments to begin with */
d$head_ct <-sum(sample(0:1,200,repl=TRUE));
d;
exp_num head_ct
1 1 85
2 2 85
3 3 85 /* the same scalar value is
applied to all the rows */
So I tried using "within", and "for", and making the "sum( "...