similar to: How to calculate cumulative values for a simple Bernoulli's distribution?

Displaying 20 results from an estimated 3000 matches similar to: "How to calculate cumulative values for a simple Bernoulli's distribution?"

2011 Feb 01
1
Lmer binomial distribution x HLM Bernoulli distribution
Dear R-users, I'm running a lmer model using the lme4 package. My dependent variable is dichotomous and I'm using the "binomial" family. The results are slightly different from the HLM results based on a Bernoulli distribution. I read that a Bernoulli distribution is an extension of a binomial distribution. Is that right? If so, how can I adapt my R model to a Bernoulli
2008 Jan 02
1
Random Bernoulli sequences with given point-biserial correlation?
Dear R-listers, Can someone suggest a method for generating a finite Bernoulli sequence that is likely to have a given point-biserial correlation with an existing Bernoulli sequence? _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall
2007 Jul 03
3
generating correlated Bernoulli random variables
Hi all, I was wondering how to generate samples for two RVs X1 and X2. X1 ~ Bernoulli (p1) X2 ~ Bernoulli (p2) Also, X1 and X2 are correlated with correlation \rho. Regards, Vineet [[alternative HTML version deleted]]
2005 Apr 12
1
Cumulative Points and Confidence Interval Manipulation in barplot2
R-Users, I am working with gplots (in gregmisc bundle) plotting some posterior probabilities (using barplot2) of harvest bag limits for discrete data (x-axis from 0 to 12, data is counts) and I ran into a couple of questions whose solutions have evaded me. 1) When I create and include the confidence intervals, the lower bound of the confidence intervals for several of the posterior probabilities
2001 Mar 08
1
deviance in glm
Folks, I am not sure if it's a feature or a "bug". The same is observed in Splus. Suppose I have Poisson counts, and I would like to estimate the parameter using glm. I would assume I can feed it the individual counts, or I can feed it the distinctive counts with the frequency as the weights, and I would get the same results. I do, but the deviance df are returned differently.
2010 May 23
2
Bernoulli random variable with different probability
Dear R-helpers, I would like to generate a variable that takes 0 or 1, and each subject has different probabilities of taking the draw. So, which of the following code I should use ? suppose there are 5 subjects, and their probabilities of this Bernoulli variable is p=c(0.2, 0.9, 0.15, 0.8, 0.75) n<-5 Ber.var <- rbimon(n,1,p) ## I doubt if this will take the first probability, which is
2011 Jun 26
2
how to extract data from a function printout - example provided
Hi there, Does anyone know how to extract data from a function that prints out two or more summaries? In the function below (the whole code is provided) we get 5 different tables of data. I would like to split each of these tables in a separate file (while the function itself shouldn't be changed), so that further analysis on each data set could be carried out. Your help is deeply
2006 Oct 06
1
Sum of Bernoullis with varying probabilities
Hi Folks, Given a series of n independent Bernoulli trials with outcomes Yi (i=1...n) and Prob[Yi = 1] = Pi, I want P = Prob[sum(Yi) = r] (r = 0,1,...,n) I can certainly find a way to do it: Let p be the vector c(P1,P2,...,Pn). The cases r=0 and r=n are trivial (and also are exceptions for the following routine). For a given value of r in (1:(n-1)), library(combinat) Set <- (1:n)
2007 Jan 26
1
Bayesian inference: Poisson distribution with normal (!) prior
Hello, for a frequency modelling problem I want to combine expert knowledge with incoming real-life data (which is not available up to now). The frequency has to be modelled with a poisson distribution. The parameter lambda has to be normal distributed (for certain reasons we did not NOT choose gamma althoug it would make everything easier). I've started with the subsequent two functions to
2010 Jun 28
0
Speex
Hi Can you advise me of the current status of Speex. I see that it's been at 1.2rc1 for a couple of years now. Is that because it's no longer an active project, or is it because it works, and doesn't need further development? If the latter, are there any known issues that need to be worked around? Kind regards, Paul ________________________________ Paul Bannister Director
2011 Jul 05
2
sample function with different proportions
Hi there, I guess this is an easy one, but still:  I would like to randomly sample 0s and 1s but in a way that I end up having for example 70% of 1s and the rest of 0s and not 50:50 as this function does: sample(c(0,1), 100, replace = TRUE) Any recommendations? Many thanks! Ana [[alternative HTML version deleted]]
2008 Sep 21
1
Calculating interval for conditional/unconditional correlation matrix
Hi there, Could anyone please help me to understand what should be done in order not to get this error message: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Here is my code: determinant<- function(x){det(matrix(c(1.0,0.2,0.5,0.8,0.2,1.0,0.5,0.6,0.5,0.5,0.5,1.0,x,0.8,0.6,x,1.0),ncol=4,byrow=T))} matrix<-
2001 Oct 02
4
plot of Bernoulli data
I have some Bernoulli data something like this: x<-sort(runif(100,1,20)) p<-pnorm(x,10,3) y<-as.numeric(runif(x)<p) plot(x,y) lines(x,p) This plot is not very satisfactory because the ogive does not visually fit the (0,1) points very well, and also because the points tend to fall on top of one another. The second problem can be eliminated by adding vertical jitter. However I was
2008 Sep 22
1
gbm error
Good afternoon Has anyone tried using Dr. Elith's BRT script? I cannot seem to run gbm.step from the installed gbm package. Is it something external to gbm? When I run the script itself <- gbm.step(data=model.data, gbm.x = colx:coly, gbm.y = colz, family = "bernoulli", tree.complexity = 5, learning.rate = 0.01, bag.fraction = 0.5) ... I
2010 Jul 18
2
loop troubles
Hi all, I appreciate the help this list has given me before. I have a question which has been perplexing me. I have been working on doing a Bayesian calculating inserting studies sequentially after using a non-informative prior to get a meta-analysis type result. I created a function using three iterations of this, my code is below. I insert prior mean and precision (I add precision manually
2012 Aug 05
1
Possible bug with MCMCpack metropolis sampler
Hi, I'm having issues with what I believe is a bug in the MCMCpack's MCMCmetrop1R function. I have code that basically looks like this: posterior.sampler <- function(data, prior.mu){ log.posterior <- function(theta) log.likelihood(data, theta) + log.prior(prior.mu, theta) post.samples <- MCMCmetrop1R(log.posterior, theta.init=prior.mu, burnin=100, mcmc=1000, thin=40,
2008 Sep 27
0
compute posterior mean by numerical integration
Dear R useRs, i try to compute the posterior mean for the parameters omega and beta for the following posterior density. I have simulated data where i know that the true values of omega=12 and beta=0.01. With the function postMeanOmega and postMeanBeta i wanted to compute the mean values of omega and beta by numerical integration, but instead of omega=12 and beta=0.01 i get omega=11.49574 and
2016 Apr 28
0
New book: Beginner's Guide to Zero-Inflated Models with R
We are pleased to announce the following book: Title: Beginner's Guide to Zero-Inflated Models with R Authors: Zuur, Ieno Book website: http://www.highstat.com/BGZIM.htm Paperback or EBook can be order (exclusively) from: http://www.highstat.com/bookorder.htm TOC: http://www.highstat.com/BGS/ZIM/pdfs/TOCOnly.pdf Keywords: 430 pages. Zero inflated count data. Zero inflated continuous data.
2011 Mar 21
1
Randomly generating data
Hi, everybody, I have a problem and need your help. There are two columns that look like this: [1,] "t" "f" [2,] "f" "t" [3,] "t" "f" [4,] "t" "t" [5,] "f" "f" I just want to generate the third column based on these two columns. First, I randomly choose one of the two columns,
2004 Feb 16
0
How do we obtain Posterior Predictive (Bayesian) P-values in R (a sking a second time)
Dear Friends, According to Gelman et al (2003), "...Bayesian P-values are defined as the probability that the replicated data could be more extreme than the observed data, as measured by the test quantity p=pr[T(y_rep,tetha) >= T(y,tetha)|y]..." where p=Bayesian P-value, T=test statistics, y_rep=data from replicated experiment, y=data from original experiment, tetha=the function