similar to: plot of Bernoulli data

Displaying 20 results from an estimated 9000 matches similar to: "plot of Bernoulli data"

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]]
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 Oct 11
1
warning with cut2 function
Dear r user, please find my attached sample of the dataset i? am using to create a crosstable and eventually plot a histogram from the output. I am using? the cut2 function to create bins, about 7 of them using the code after reading the data: cluster <- cut2(cross_val$value, g=7) I get the warning: Warning message: In min(xx[xx > upper]) : no non-missing arguments to min; returning Inf
2008 Oct 20
4
aggregating along bins and bin-quantiles
Dear all, I would like to aggregate a data frame (consisting of 2 columns - one for the bins, say factors, and one for the values) along bins and quantiles within the bins. I have tried aggregate(data.frame$values, list(bin = data.frame $bin,Quantile=cut2(data.frame$bin,g=10)),sum) but then the quantiles apply to the population as a whole and not the individual bins. Upon this
2009 Oct 23
1
cut2 once, bin twice...
Hello, I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to bins based on factors defined by my call to cut 2. Does anyone know how I can do this? Thank you, -S -- View this message
2011 Jan 16
3
rootogram for normal distributions
Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand why a rootogram displaying samples from the Poisson distribution looks like I expected it, whereas a rootogram using the normal distribution does not: library(latticeExtra) rootogram(~rpois(1000, lambda = 50), dfun = function(x) dpois(x, lambda = 50)) rootogram(~rnorm(1000), dfun = function(x) dnorm(x,mean(x),sd(x))) I
2008 Jan 24
2
testing coeficients of glm
Dear list, i'm trying to test if a linear combination of coefficients of glm is equal to 0. For example : class 'cl' has 3 levels (1,2,3) and 'y' is a response variable. We want to test H0: mu1 + mu2 - mu3 =0 where mu1,mu2, and mu3 are the means for each level. for me, the question is how to get the covariance matrix of the estimated parameters from glm. but perhaps there
2007 Dec 13
3
what does cut(data, breaks=n) actually do?
Hello, I'm trying to bin a quantity into 2-3 bins for calculating entropy and mutual information. One of the approaches I'm exploring is the cut() function, which is what the mutualInfo function in binDist uses. When it's called in the format cut(data, breaks=n), it somehow splits the data into n distinct bins. Can anyone tell me how cut() decides where to cut? Thanks, Melissa
2006 Jun 29
2
Biobass, SAGx, and Jonckheere-Terpstra test
Hi list, I tried to load the package SAGx and failed because it complains it's looking for the Biobass which is not there. Then I looked up the package list and Biobass is not found. I'm trying to run the Jonckheere-Terpstra test and from what I see in the R archive, SAGx is the only place it's been implemented. > library(SAGx) Loading required package: multtest Loading required
2013 Feb 01
2
Nested loop and output help
Hello Everyone, My name is Thomas and I have been using R for one week. I recently found your site and have been able to search the archives of posts. This has given me some great information that has allowed me to craft an initial design to an inquiry I would like to make into the breakdown of McNemar's test. I have read an intro to R manual and the posting guides and hope I am not violating
2012 Oct 17
2
loop of quartile groups
Greetings R users, My goal is to generate quartile groups of each variable in my data set. I would like each experiment to have its designated group added as a subsequent column. I can accomplish this individually with the following code: brks <- with(data_variables, cut2(var2, g=4)) #I don't want the actual numbers, I need a numbered group data$test1=factor(brks,
2012 Oct 17
2
cut2 error
To R users, I am trying to use cut2 function from the 'Hmisc' library. However, when I try and run the function on the following variable, I get an error message (displayed below). I suspect it is because of the NA but I have no idea how to address the error. Many thanks to any insights. structure(list(var1 = c(97, 97, 98, 98, 97, 99, 97, 98, 99, 98, 99, 98, 98, 97, 97, 98, 99, 98,
2004 Jul 06
3
Improving effeciency - better table()?
Hi, I've been running some simulations for a while and the performance of R has been great. However, I've recently changed the code to perform a sort of chi-square goodness-of-fit test. To get the observed values for each cell I've been using table() - specifically I've been using cut2 from Hmisc to divide up the range into a specified number of cells and then using
2005 Jul 13
3
nlme, MASS and geoRglm for spatial autocorrelation?
Hi. I'm trying to perform what should be a reasonably basic analysis of some spatial presence/absence data but am somewhat overwhelmed by the options available and could do with a helpful pointer. My researches so far indicate that if my data were normal, I would simply use gls() (in nlme) and one of the various corSpatial functions (eg. corSpher() to be analagous to similar analysis in SAS)
2005 Oct 16
1
BIC doesn't work for glm(family=binomial()) (PR#8208)
Full_Name: Ju-Sung Lee Version: 2.2.0 OS: Windows XP Submission from: (NULL) (66.93.61.221) BIC() requires the attribute $nobs from the logLik object but the logLik of a glm(formula,family=binomial()) object does not include $nobs. Adding attr(obj,'nobs') = value, seems to allow BIC() to work. Reproducing the problem: library(nmle); BIC(logLik(glm(1~1,family=binomial())));
2009 May 20
1
sem with categorical data
I am trying to run a confirmatory factor analysis using the SEM package. My data are ordinal. I have read http://socserv.mcmaster.ca/jfox/Misc/sem/SEM-paper.pdf. When I apply the hetcor function, I receive the following error: Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr, : at least one element of 'lower' is larger than 'upper' Example:
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)
2010 Jan 07
1
LD50 and SE in GLMM (lmer)
Hi All! I am desperately needing some help figuring out how to calculate LD50 with a GLMM (probit link) or, more importantly, the standard error of the LD50. I conducted a cold temperature experiment and am trying to assess after how long 50% of the insects had died (I had 3 different instars (non significant fixed effect) and several different blocks (I did 4 replicates at a time)=