similar to: simulating a toss of a coin

Displaying 20 results from an estimated 5000 matches similar to: "simulating a toss of a coin"

2010 Oct 13
2
Coin Toss Simulation
I am trying a simple toin 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
2008 Oct 09
4
runs of heads when flipping a coin
Can someone recommend a method to answer the following type of question: Suppose I have a coin with a probability hhh of coming up heads (and 1-hhh of coming up tails) I plan on flipping the coin nnn times (for example, nnn = 500) What is the expected probability or frequency of a run of rrr heads* during the nnn=500 coin flips? Moreover, I would probably (excuse the pun) want the answer for a
2009 Aug 31
4
Offtopic, HT vs. HH in coin flips
Dear R-help, Could someone please try to explain this paradox to me? What is more likely to show up first in a string of coin tosses, "Heads then Tails", or "Heads then Heads"? ##generate 2500 strings of random coin flips ht <- replicate(2500, paste(sample(c("H", "T"), 100, replace = TRUE), collapse =
2011 Oct 31
2
one sample Wilcoxon test using 'coin'
Hi, R allows me to run a one sample Wilcoxon test like this: wilcox.test(c(1,3.5,2.1,4,1.5,5), mu=2, exact=TRUE) The function 'wilcoxsign_test' from the package 'coin' should (I suppose) be able to calculate exact p values even if there are ties in the ranks. However, I couldn't find information on how to run a one sample test using 'wilcoxsign_test' like in the
2010 Apr 22
2
Jonckheere-Terpstra test using coin package?
Is it possible to implement the Jonckheere-Terpstra test for ordered alternatives using the coin package: Conditional Inference Procedures in a Permutation Test Framework? I found jonckheere.test{clinfun}, but it uses a normal approximation when ties are present in the data. To make this concrete, I've include a small dataset. Thanks. --Dale Hollander and Wolfe, 1999 Table 6.6, pg 205
2009 Oct 25
1
A naive question about permutation tests in the coin package
Dear R helpers, I am trying to understand how to use the independence_test function in the coin package. I think I suffer from a misunderstanding about what the package does. Either that or I do not understand how to use it properly. Specifically, I cannot understand if I can test independence of arbitrary statistics. Take the following example: set.seed(10) d <- data.frame(y = c(rnorm(10,
2013 Sep 23
1
Permutation Test on Interactions {coin}
Dear List, I'm interested in performing a permutation test on the interaction between a binary treatment indicator and a covariate (either continuous or categorical). I'm interested in the p-value of the interaction effect from a permutation test, and I'm using the coin package for that purpose. As I haven't seen any examples like this in the package documentation (or anywhere
2012 Jul 21
4
rhsape2 bug?
All, I believe I am running the latest version of rshape2 (1.2.1). But this code: library(reshape2) tmp <- melt(smiths, id.vars=1:2, measure.vars=c("age","weight","height"), variable.name="myvars", value.name="myvals" ) names(tmp) Produces this output: > names(tmp) [1] "subject" "time"
2012 Jan 09
2
Unexpected results using the oneway_test in the coin package
Dear fellow R users, Keywords: Kruskal-Wallis, Post-Hoc, pair-wise comparisons, Nemenyi-Damico-Wolfe-Dunn test, coin package, oneway_test I am using the "oneway_test" function in the R package "coin" and I am obtaining results which I cannot believe are accurate. I do not wish to waste anyone's time and so if the following problem is rather trivial, I apologize, however I
2009 May 07
1
error using lapply with oneway_test (coin package)
Dear expeRts, I would like to use a oneway_test (from package coin) to test whether two groups differ on various variables. The variables are encoded within a data frame. Unfortunately, I obtained an error, that I don't understand. Could you please help me ? Example: library(coin) y <- as.data.frame(matrix(rnorm(200), ncol=2)) group <- as.factor(unif(100)) lapply(y,
2013 Feb 12
2
Data sets online for student use
All, If you have any good links for sites that contain data sets that can easily be accessed and copied (or downloaded) by students in introductory statistics, could you please share them? Thanks. David -- View this message in context: http://r.789695.n4.nabble.com/Data-sets-online-for-student-use-tp4658326.html Sent from the R help mailing list archive at Nabble.com.
2010 Dec 10
1
New Installs, Same Trouble Loading doBy and coin Packages
I tried Tal's suggestion of deleting the doBy and coin packages and then reinstalling them from a different mirror. The first install was from the Harvard mirror and the second was from the Case Western Univ. mirror. The new packages generate the same errors when I call them using the library() command. Also, I tried to load these packages using R and its script editor thinking that the
2010 May 30
2
Question about package coin
Anyone know if coin can run a permutation test based on a (user-defined) statistic other than the mean difference? The function independence_test does the permutation t-test via difference in means. I'm wondering if it's possible to use independence_test to run a permutation test for some other statistic than the difference in means. For example, I'd like to run a permutation test
2010 Feb 08
1
Wilcoxon signed-ranks test using package coin ?
Given the following data, and hypothesized median M.0 I've found a method to implement the Wilcoxon signed-rank test. Data: (with one zero difference and tied ranks) x <- c(136, 103, 91, 122, 96, 145, 140, 138, 126, 120, 99, 125, 91,142, 119, 137) M.0 <- 119 > library(exactRankTests) Package ?exactRankTests? is no longer under development. Please consider using package ?coin?
2006 Sep 29
1
Wilcoxon Rank test of Package Coin
Hi, I am running the following example which can be found on page 12 of the pdf file of COIN package wt<-wilcox_test(pd~age,data=water_transfer,distribution="exact", conf.int=TRUE) "wt" actually contains the estimate of difference in location and the confidence interval of it. I am just wondering how can I extract these values? From the examples, I understand that the
2012 Aug 03
2
Printing a summary
All, Is this typical of how people will print a summary of results? CoinTosses <- function(n) { x <- sample(c(0,1), n, replace=TRUE) y <- x y[y==0] <- "T" y[y==1] <- "H" numHeads <- sum(x) numTails <- n-sum(x) p <- numHeads/n cat(cat(y,sep=""),"\n") cat("Number of heads: ", numHeads, "\n")
2010 Dec 08
1
Trouble Loading doBy and coin Packages
Good Evening R-Help Community: I have attached a file that contains the output from sessionInfo() and a summary of my Win XP system. I am?running R 2.12.0 and using Tinn-R 2.3.6.2 as my interface. When I attempt to call either the doBy or coin packages R generates an error that I do not understand and have so far not been able to resolve by searching R resources. I exchanged a couple of
2010 Feb 24
1
extracting results from wilcox_test (package::coin)
Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by() to group by site Output is a list: >Herb.KW Herb.df$ID: 10-1 Kruskal-Wallis rank sum test data: Indicator_Rating by Year Kruskal-Wallis chi-squared = 15.24, df = 7, p-value = 0.03302 ----------------------------------------------------------------------------------------------------- Herb.df$ID: 18-1
2007 Oct 15
2
Need some help
Hi! I'm taking a course that requires some programming background, but I'm a complete novice in the field. when asked to generate a list of 20 uniform random numbers, is it alright if I put in >randu, and just copy-paste the first 20 numbers?? Or is there, as I suspect, a better way of calling out exactly 20 uniform random numbers?? I'm also unable to solve the following problem:
2019 Aug 05
1
[PATCH v2] drm/qxl: get vga ioports
qxl has two modes: "native" (used by the drm driver) and "vga" (vga compatibility mode, typically used for boot display and firmware framebuffers). Accessing any vga ioport will switch the qxl device into vga mode. The qxl driver never does that, but other drivers accessing vga ports can trigger that too and therefore disturb qxl operation. So aquire the legacy vga ioports