Displaying 20 results from an estimated 600 matches similar to: "Bernoulli random variable with different probability"
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 Jul 09
1
Appropriate tests for logistic regression with a continuous predictor variable and Bernoulli response variable
I have a data with binary response variable, repcnd (pregnant or not) and one predictor continuous variable, svl (body size) as shown below. I did Hosmer-Lemeshow test as a goodness of fit (as suggested by a kind “R-helper” previously). To test whether the predictor (svl, or body size) has significant effect on predicting whether or not a female snake is pregnant, I used the differences between
2010 May 13
3
select subset based on another variable
Hi, dear R-helpers,
I have a simple question regarding selecting subset of a variable based on
another variable.
Here is the example:
xx=rnorm(10)
id=sample(1:10, 10)
temp=c(6, 1, 8, 2)
Now, all I want is xx's that their id are 6, 1, 8, 2, instead of the
position.
Any suggestions ?
Thank you all your help !!
Carrie
[[alternative HTML version deleted]]
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
2010 Jun 26
4
integration of two normal density
Hello everyone,
I have a question about integration of two density function
Intuitively, I think the value after integration should be 1, but they are
not. Am I missing something here ?
> t=function(y){dnorm(y, mean=3)*dnorm(y/2, mean=1.5)}
> integrate(t, -Inf, Inf)
0.3568248 with absolute error < 4.9e-06
Also, is there any R function or package could do multivariate integration ?
2010 Jun 23
3
integrate dmvtnorm
Hello, everyone,
I have a question about integration of product of two densities.
Here is the sample code; however the mean of first density is a function of
another random variable, which is to be integrated.
##
f=function(x) {dmvnorm(c(0.6, 0.8), mean=c(0.75, 0.75/x))*dnorm(x, mean=0.6,
sd=0.15)}
integrate(f, lower=-Inf, upper=Inf)
## error message
Error in dmvnorm(c(0.6, 0.8), mean = c(0.75,
2011 Feb 07
2
questions about counting numbers
Hello R-helpers,
I have a question about counting numbers.
Here is a simple example.
a=c(2, 3, 3,4)
> table(a)
a
2 3 4
1 2 1
so, I can to create another variables that has the corresponding counting
numbers.
In this case, I want to have:
b=c(1,2,2,1)
Is there any way coding for this ?
Thanks for helps!
Carrie--
[[alternative HTML version deleted]]
2010 Jun 25
1
what "density" is plotting ?
Hi everyone,
I am confused regarding the function "density".
suppose that there is a sample x of 100 data points, and plot(density(x))
gives it's pdf ?
or it's more like histogram only ?
thanks for any answering
Carrie
[[alternative HTML version deleted]]
2011 May 08
1
questions about the output of "gee" and its summary
Dear R-helpers,
I am using the package "gee" to run a marginal model.
Here is the output.
In my simulated data, both x and z are time-varying, so I include their
interaction terms with time indicator (i.e. tind=0, if time 1, and 1 if time
2)
The data is simulated, so the true parameter of z both at time 1 and time 2
is 5, which is very close from the model output
for time 1, z =
2008 Aug 27
0
How to calculate cumulative values for a simple Bernoulli's distribution?
Hi there,
I have two questions and believe that there is an extremely easy solution.
Being a beginner with R makes thinks a bit more complicated.
This is the code:
rpois(15,3)
n<-15
DATA<-cbind(D,rpois(15,3))
data<-as.data.frame(DATA)
colnames(data)<-c("D","X")
*# 1. question: is it possible to put the following creation of x in a nicer
form?*
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)
2013 Apr 26
4
[LLVMdev] [Polly] GSoC Proposal: Reducing LLVM-Polly Compiling overhead
Hi all,
I have updated my GSoS proposal: "FastPolly: Reducing LLVM-Polly Compiling overhead" (https://gist.github.com/tanstar/5441808). I think the pass ordering problem you discussed early can be also investigated in this project!
Is there any comment or advice about my proposal? I appreciate all your help and advice.
Thanks,
Star Tan
Proposal:
2007 Nov 24
5
how to calculate the return?
Hi, R-users,
data is a matrix like this
AMR BS GE HR MO UK SP500
1974 -0.3505 -0.1154 -0.4246 -0.2107 -0.0758 0.2331 -0.2647
1975 0.7083 0.2472 0.3719 0.2227 0.0213 0.3569 0.3720
1976 0.7329 0.3665 0.2550 0.5815 0.1276 0.0781 0.2384
1977 -0.2034 -0.4271 -0.0490 -0.0938 0.0712 -0.2721 -0.0718
1978 0.1663 -0.0452 -0.0573 0.2751 0.1372 -0.1346
2017 Jun 01
3
Post for R
Hello,?
I want to split the dataframe into 1000 groups based on two column values(max value and second max value). First, I made two lists L1 and L2. ?L1 is the list divided into 100 groups based on the range of max value and L2 is divided into 10 groups based on the second max values. Now I want to do the combinations based on L1 and L2. I want to do a for loop for L1 and for each element in L1,
2013 May 02
0
[LLVMdev] [Polly] GSoC Proposal: Reducing LLVM-Polly Compiling overhead
On 04/26/2013 05:08 AM, tanmx_star wrote:
> Hi all,
Hi,
thanks for the update and sorry for the delay in reviewing. I just had a
look at your proposal.
> I have updated my GSoS proposal: "FastPolly: Reducing LLVM-Polly Compiling overhead" (https://gist.github.com/tanstar/5441808). I think the pass ordering problem you discussed early can be also investigated in this project!
2017 Aug 14
2
Promedio elementos vector
Buenas noches estimados colegas:
Adjunto la matriz,de la que quiero obtener, los promedios de cada elemento
de los vectores que la componen. Me explico, el primer vector, tiene como
primer elemento 23 y la suma de todos los elementos es 134; por lo tanto
el promedio será 0.1716, el segundo elemento de dicho vector es 20,
entonces el promedio sería 0.1492, del tercero el promedio es 0.1343 y así
2001 Dec 19
4
Win2k -> Samba 2.2.2 for IRIX
Hello,
I've been searching through the Samba archives attempting to
find a resolution to intermittent Win2k -> Samba 2.2.2 for
IRIX share failures. It seems that there have been
numerous failures similar to mine reported with various
versions of Samba and various OS's, but I've been unable to
find a workable resolution.
Intermittently when connecting to a Samba share from Win2k
2011 Mar 04
2
questions about using loop, while and next
Hello R helpers,
I have a quick question about loop and next
In my loop, I have some random generation of data, but if the data doesn't
meet some condition, then I want it to go next, and generate data again for
next round.
# just an example..
# i want to generate the data again, if the sum is smaller than 25
temp=rep(NA, 10)
for(i in 1:10)
{
dt=sum(rbinom(10, 5, 0.5))
while (dt<25) next