Displaying 20 results from an estimated 1100 matches similar to: "i param in "for" loop does not takes zeros?"
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example.
I modified a little to fit my real data, I got an error massage.
Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) :
Group length is 0 but data length > 0
On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] <
ml-node+s789695n4657196h87@n4.nabble.com> wrote:
> Hi,
> Try this:
>
2007 Apr 05
1
binom.test() query
Hi Folks,
The recent correspondence about "strange fisher.test result",
and especially Peter Dalgaard's reply on Tue 03 April 2007
(which I want to investigate further) led me to take a close
look at the code for binom.test().
I now have a query!
The code for the two-sided case computes the p-value as follows:
if (p == 0) (x == 0)
else
if (p == 1) (x == n)
2007 Apr 06
1
dbinom and Catherine Loader
Hi Folks,
There has been past correspondence regarding Catherine Loader's
Bell Labs (oops, Lucent) paper
"Fast and Accurate Computation of Binomial Probabilities"
which gives the algorithm on which R's dbinom() is based.
The original URL given in the R documentation "?dbinom" is:
http://cm.bell-labs.com/cm/ms/departments/sia/catherine/dbinom
but this link is
2009 Apr 17
5
Binomial simulation
Hi Guy's
I was wondering if someone could point me in the right direction.
dbinom(10,1,0.25)
I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges
choosing a certain brand x times.
I was wondering how I would go about simulating 1000 trials of each x value
?
regards
Brendan
--
View this message in context:
2010 Feb 21
1
how do I get the legend?
http://en.wikipedia.org/wiki/Binomial_distribution Bino
Hi there,
How can I get the legend in the probability density plot in that
http://en.wikipedia.org/wiki/File:Binomial_distribution_pmf.svg wiki page ?
and the cumalative plot as well?
====================================
# Binomial Distribution
x=0:40
2011 Mar 19
2
problem running a function
Dear people,
I'm trying to do some analysis of a data using the models by Royle & Donazio
in their fantastic book, particular the following function:
http://www.mbr-pwrc.usgs.gov/pubanalysis/roylebook/panel4pt1.fn
that applied to my data and in the console is as follows:
> `desman.y` <- structure(c(3L,4L,3L,2L,1L), .Names = c("1", "2", "3",
2009 Feb 05
1
Incorrect p value for binom.test?
I believe the binom.test procedure is producing one tailed p values
rather than the two tailed value implied by the alternative hypothesis
language. A textbook and SAS both show 2*9.94e-07 = 1.988e-06 as the
two tailed value. As does the R summation syntax from R below. It
looks to me like the alternative hypothesis language should be revised
to something like " ... greater than or equal
2009 Jan 05
2
Sweave data-figure coupling
Hi,
With the following Sweave minimal file:
---<--------------------cut here---------------start------------------->---
\documentclass{article}
\usepackage{Sweave}
\begin{document}
<<binom-sim>>=
thetas <- seq(0, 1, by=0.001)
prior <- rep(1, length(thetas)) / length(thetas)
lik <- dbinom(1, 1, thetas)
lik.p <- prior * lik
post <- lik.p / sum(lik.p)
2006 Mar 22
4
pbinom( ) function (PR#8700)
Full_Name: Chanseok Park
Version: R 2.2.1
OS: RedHat EL4
Submission from: (NULL) (130.127.112.89)
pbinom(any negative value, size, prob) should be zero.
But I got the following results.
I mean, if a negative value is close to zero, then pbinom() calculate
pbinom(0, size, prob). dbinom() also behaves similarly.
> pbinom( -2.220446e-22, 3,.1)
[1] 0.729
> pbinom( -2.220446e-8, 3,.1)
2012 Apr 19
1
non-numeric argument in mle2
Hi all,
I have some problems with the mle2 function
> RogersIIbinom <- function(N0,attackR3_B,Th3_B)
{N0-lambertW(attackR3_B*Th3_B*N0*exp(-attackR3_B*(24-Th3_B*N0)))/(attackR3_B*Th3_B)}
> RogersII_B <-
mle2(FR~dbinom(size=N0,prob=RogersIIbinom(N0,attackR3_B,Th3_B)/N0),start=list(attackR3_B=1.5,Th3_B=0.04),method="Nelder-Mead",data=dat)
Error in dbinom(x, size, prob, log)
2020 May 18
3
dbinom link
In principle a good idea, but I'm not sure the whereabouts of Catherine Loader are known at this point. Last peeps from her on the net seem to be about a decade old.
.pd
> On 18 May 2020, at 10:31 , Abby Spurdle <spurdle.a at gmail.com> wrote:
>
> This has come up before.
>
> Here's the last time:
> https://stat.ethz.ch/pipermail/r-devel/2019-March/077478.html
2020 May 18
2
dbinom link
FWIW the link from ?dbinom to the Loader paper on Binomials is broken but the paper seems to be
available here: https://octave.1599824.n4.nabble.com/attachment/3829107/0/loader2000Fast.pdf
Roger Koenker
r.koenker at ucl.ac.uk<mailto:r.koenker at ucl.ac.uk>
Honorary Professor of Economics
Department of Economics, UCL
Emeritus Professor of Economics
and Statistics, UIUC
[[alternative
2005 Nov 30
3
strange plots with type = "h" option
Hello,
With the new version 2.2.0, I get strange plots when using the
histogram-like option in plot(). For example, a plot of binomial
probabilities:
> plot(0:10,dbinom(0:10,10,.1), type = "h", lwd = 30)
gives me weird fat cirular bars, with mass out at values with low
probability. What is the issue here? This never happened with earlier
versions.
R on Windows XP SP 2
Intel
2000 Sep 25
1
No subject
Dear friends. In Carlin and Louis "Bayes and emperical Bayes methods.."
1996 the classical example of 12 independent tosses of a fair coin
producing 9 heads and 3 tails is given. If the situation is seen as a fixed
sample of 12, a binomial lieklihood is used, and Carlin et al reports a
probability of 0.075.
Using sum(dbinom(9:12,12,.5)) I obtain 0.073
Likewise, if the experiment is
2008 Sep 22
1
Likelihood between observed and predicted response
Thank you so much for your help.
The function "dbinom" seems to work very well.
However, I'm a bit lost with the "dnorm" function.
Apparently, I have to compute the mean "mu" and the standard deviation
"sd" but what does it mean exactly? I only have a vector of predicted
response and a vector of observed response that I would like to compare!
What
2005 Nov 23
3
Infinite recursion in S3 methods crashes R on windows (related to PR#8203?)
Hi,
Infinite recursion in S3 methods seem to crash R on Windows 2000 (R
terminating with the ("Rgui.exe has generated errors...") message,
rather than throwing an error. This happens with both Rgui and Rterm.
The following toy example triggers this:
myf <- function(x, ...)
UseMethod("myf")
myf.default <- function(x, ...)
myf(x)
myf(1)
...R crashes...
Which I
2020 Feb 29
4
dput()
My interpretation of dput.Rd is that dput() gives an exact ASCII form
of the internal representation of an R object. But:
rhankin at cuttlefish:~ $ R --version
R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
[snip]
rhankin at cuttlefish:~ $ R --vanilla --quiet
> x <-
2008 Aug 21
3
[help] simulation of a simple Marcov Stochastic process for population genetics
Hi, this is my first time using R. I want to simulate the following process:
"in a population of size N, there are i individuals bearing genotype A, the
number of those bearing A is j in the next generation, which following a
binominal distribution (choose j from 2*N, the p is i/2*N), to plot the
probability of the next generations, my script is as follows. It cannot run
successfully,
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
2023 Dec 02
1
Try reproduce glmm by hand
Dear all,
In order to be sure I understand glmm correctly, I try to reproduce by
hand a simple result. Here is a reproducible code. The questions are in
_________________
Of course I have tried to find the solution using internet but I was not
able to find a solution. I have also tried to follow glmer but it is
very complicated code!
Thanks for any help.
Marc
# Generate set of df with nb