Displaying 20 results from an estimated 45 matches for "francogrex".
2008 May 22
4
Binning groups
Hi, this is probably quite simple but I can't seem to do it correctly. I have
a data frame of counts of infections in different ages; something like:
count=c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 7, 8, 8, 9, 9,
10, 11, 15, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 20, 21, 21,
21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 25, 27, 31, 33
)
age=c(3, 8, 9, 7, 56, 58, 10, 13, 53, 55, 11,
2008 Apr 18
3
Permanent change to the working directory
Dear helpers,
I've looked in the help files (maybe not very thoroughly but I looked) and I
couldn't find a straightforward way to permanently set the working directory
(where I save and read files). Each time I startup R the working dir is
automatically "C:/R/bin" [using:getwd()], and I know I can change it using
setwd [for example setwd("C:/R/DATA"), but it's only
2007 Jan 05
2
maximum likelihood estimation of 5 parameters
Hi Guys, it would be great if you could help me with a MLE problem in R.
I am trying to evaluate the maximum likelihood estimates of theta = (a1,
b1, a2, b2, P) which defines a mixture of a Poisson distribution and two
gamma prior distributions (where the Poisson means have a gamma
distribution, actually 2 gammas and P is the mixing factor). The likelihood
function for theta is L(theta) = Pi,j{P
2007 Jul 30
2
deriv, loop
Hi, 2 questions:
Question 1: example of what I currently do:
for(i in 1:6){sink("temp.txt",append=TRUE)
dput(i+0)
sink()}
x=scan(file="temp.txt")
print(prod(x))
file.remove("C:/R-2.5.0/temp.txt")
But how to convert the output of the loop to a vector that I can manipulate
(by prod or sum etc), without having to write and append to a file?
Question 2:
>
2007 Nov 16
2
expand.grid overflows?
>cbn<-as.matrix(expand.grid( rep( list(0:1), 50)))
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :
invalid 'times' value
In addition: Warning message:
In rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) :
NAs introduced by coercion
But I'm only interested in cbn matrix rows where:
cbn<- cbn[rowSums(cbn)==5,]
Is there a way to evaluate it
2007 Apr 25
4
How to solve difficult equations?
This below is not solvable with uniroot to find "a":
fn=function(a){
b=(0.7/a)-a
(1/(a+b+1))-0.0025
}
uniroot(fn,c(-500,500)) gives
"Error in uniroot(fn, c(-500, 500)) : f() values at end points not of
opposite sign"
I read R-help posts and someone wrote a function:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/92407.html
but it is not very precise. Is there any
2007 Apr 19
3
A structured output from for(i...)?
Hello I am using the "for (i...)" and a sink() into a file. But the output I
am having is not arranged in either a vector or any other good structure. I
would like to have the output in a file directly as a vector so that I do
not have to edit the [1] and [6] etc and that the values are comma
separated. Is there a way? Thanks.
Example data:
x=read.table(file="pw.power.txt")
2008 Apr 21
1
Symbolic Integration in R
This may be a question to R-development but I'm not sure. Symbolic
differentiation is implemented in R (maybe not for extremely complex
expressions), but it proves that it can be done. I know that in C++ it can
be done (symbolic c++), do you think in R it can be programmed just using
the R language without resorting to external sources? Does anyone know or
can estimate the amount of resources
2007 May 14
1
Hierarchical models in R
Is there a way to do hierarchical (bayesian) logistic regression in R, the
way we do it in BUGS? For example in BUGS we can have this model:
model
{for(i in 1:N) {
y[i] ~ dbin(p[i],n[i])
logit(p[i]) <- beta0+beta1*x1[i]+beta2*x2[i]+beta3*x3[i]
}
sd ~ dunif(0,10)
tau <- pow(sd, -2)
beta0 ~ dnorm(0,0.1)
beta1 ~ dnorm(0,tau)
beta2 ~ dnorm(0,tau)
beta3 ~
2007 May 03
1
Bayesian logistic regression with a beta prior (MCMClogit)
Dear all,
I am trying to use the logistic regression with MCMClogit (package:
MCMCpack/Coda) and I want to put a beta prior on the parameters, but it's
giving me error message (please see output below) no matter what shape 1 or
2 I use. It works perfect with the cauchy or normal priors. Do you know if
there is a catch there somewhere? Thanks
logpriorfun <- function(beta,shape1,shape2){
2007 Jan 11
1
maximum likelihood, 1st and 2nd derivative
Hi guys again, it seems I haven't been doing the maximum likelihood
estimation correctly. I quote below, can someone explain to me please what
does it mean that the 2nd and 3rd derivatives of the function equals zero
and how to compute that in R.
"We have our initial estimated, subjective parameters for the gamma mixture
and we have our likelihood that is the mixture of negative
2009 Jan 02
2
Where to find old R packages?
What happens to old R packages? Is there a place where they are stored like
an archive? I'm looking for a package called ScanoR that doesn't exist
anymore on CRAN, the author doesn't exist anymore... I had made copies of
all packages (fearing that some might be "taken off the air" but
unfortuantely the ScanoR package was removed before I started making copies
in 2007). Any
2011 Oct 06
2
KS test and theoretical distribution
> x <- runif(100)
> y <- runif(100)
> ks.test(x,y)
Two-sample Kolmogorov-Smirnov test
data: x and y
D = 0.11, p-value = 0.5806
alternative hypothesis: two-sided
ok I expected that, but:
> ks.test(runif(100), "runif")
One-sample Kolmogorov-Smirnov test
data: runif(100)
D = 0.9106, p-value < 2.2e-16
alternative hypothesis: two-sided
How
2008 Jan 10
1
data.frame manipulation: Unbinding strings in a row
Hi all,
I have a data.frame I received with data that look like this (comma
separated strings in last row):
ID Shop Items
ID1 A1 item1, item2, item3
ID2 A2 item4, item5
ID3 A1 item1, item3, item4
But I would like to unbind the strings in col(2) items so that it will look
like this:
ID Shop Items
ID1 A1 item1
ID1 A1 item2
ID1 A1 item3
ID2 A2 item4
ID2 A2 item5
ID3 A1 item1
ID3 A1 item3
ID3 A1
2012 Jun 20
2
array complexity for the MH test
If we take the matel-haenszel test on these data of five 2x2 tables
stratified along Penicillin.Levels
array(c(0, 0, 6, 5,
3, 0, 3, 6,
6, 2, 0, 4,
5, 6, 1, 0,
2, 5, 0, 0),
dim = c(2, 2, 5),
dimnames = list(
Delay = c("None", "1.5h"),
Response = c("Cured", "Died"),
Penicillin.Level =
2008 Apr 04
2
pairwise.t.test for paired data
Dear R-help, I have a question about pairwise.t.test and adjustment for
multiple comparisons for paired data points.
I have the following data:
n=c("x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "y", "y",
"y", "y", "y", "y",
2007 Nov 14
2
Generating these matrices going backwards
I have generated the following:
x=
E1 E2 E3
D1 0 0 1
D2 1 0 3
D3 0 2 0
y=
E1 E2 E3
D1 0 0 1.75
D2 1.75 0 1.3125
D3 0 3.5 0
Where x and y are linked by:
y =sum(x) * x / (rowSums(x)%o%colSums(x))
N=x[x[1:3,]>0]
R=y[y[1:3,]>0]
Now suppose I ONLY
2007 Oct 23
1
How to avoid the NaN errors in dnbinom?
Hi, The code below is giving me this error message:
Error in while (err > eps) { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In dnbinom(x, size, prob, log) : NaNs produced
2: In dnbinom(x, size, prob, log) : NaNs produced
I know from the help files that for dnbinom "Invalid size or prob will
result in return value NaN, with a warning", but I am not able
2007 Nov 06
0
Importing Data
...the person managing the list at
r-help-owner@r-project.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."
Today's Topics:
1. Help in error of mixed models (Bernardo Rangel Tura)
2. Where to ask general stats questions? (francogrex)
3. Re: structure vs. matrix (Mark Difford)
4. Problems with garch() function tseries package R 2.6.0
(Jos? Augusto Morais de Andrade J?nior - JAMAJ)
5. Re: Where to ask general stats questions? (Patrick Drechsler)
6. help on error message!!! (david csongor)
7. Re: structure vs. matrix (Duncan Murd...
2007 Jul 08
1
Extracting S code from a C program
There is a C program called GPS: 'gamma poisson shrinker' at
ftp://ftp.research.att.com/dist/gps/
The algorithms in GPS are based on S-Plus programs written by William
DuMouchel with support from Columbia University and AT&T Labs.
My question is: is there a relatively easy way to extract some of the S code
from this windows program? Thanks.
--
View this message in context: