Displaying 20 results from an estimated 700 matches similar to: "Why the contrain does not work for selecting a particular range of data?"
2006 Jul 22
1
ifelse command
Dear:
I try to revise the maximum likelihood function below using something constrains. But it seems something wrong with it. Becasue R would not allow me to edit the function like this. It is very appreciate if you can help.
function (parameters,y,x1,x2)
{
p<-parameters[1]
alpha1<-parameters[2]
beta1<-parameters[3)]
delta1<-parameters[4]
alpha2<-parameters[5]
2009 Dec 15
3
RFC: lchoose() vs lfactorial() etc
lgamma(x) and lfactorial(x) are defined to return
ln|Gamma(x)| {= log(abs(gamma(x)))} or ln|Gamma(x+1)| respectively.
Unfortunately, we haven't chosen the analogous definition for
lchoose().
So, currently
> lchoose(1/2, 1:10)
[1] -0.6931472 -2.0794415 NaN -3.2425924 NaN -3.8869494
[7] NaN -4.3357508 NaN -4.6805913
Warning message:
In
2006 May 16
1
r-help@stat.math.ethz.ch
Dear All:
I tried to fit negative binomial distribution to data in terms of mean and mean is also a quadratic function of another variable. The likelihood function is:
function (parameters, y1,x11)
{
p<-parameters[1]
alpha1<-parameters[1]
beta1<-parameters[2]
delta1<-parameters[3]
mu<-alpha1+beta1*(x11)+delta1*(x11^2)
ifelse(y1>=0|x11>=0,
L<-
2009 Jul 30
1
lmer() and "$ operator is invalid for atomic vectors"
Hi all,
I am a bit mystified by this error message that I get when I try to apply
lmer() to a simple dataset with one between factor (age) and one within
factor (item): "$ operator is invalid for atomic vectors"
I'll just provide the code, because I don't see where the problem is:
library(lme4)
options(contrasts=c("contr.helmert","contr.poly"))
data =
2023 Aug 25
2
Query on finding root
Sir,
I want to solve the equation Q(u)=mean, where Q(u) represents the quantile
function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is the quantile
function of Davies (Power-pareto) distribution. Hence I want to solve ,
*(c*u^lamda1)/((1-u)^lamda2)=28353.7....(Eq.1)*
where lamda1=0.03399381, lamda2=0.1074444 and c=26104.50. When I used the
package 'Davies' and solved Eq 1, I got the
2023 Aug 27
1
Query on finding root
On Fri, 25 Aug 2023 22:17:05 +0530
ASHLIN VARKEY <ashlinvarkey at gmail.com> wrote:
> Sir,
Please note that r-help is a mailing list, not a knight! ??
> I want to solve the equation Q(u)=mean, where Q(u) represents the
> quantile function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is
> the quantile function of Davies (Power-pareto) distribution. Hence I
> want to
2006 Nov 15
1
OPTIM--non finite finite different [13]
Dear All:
I used optim() to minimise the loglikelihood function for fitting data to negative binomial distribution. But there initial value of log-likelihood and iteration 10 value are reasonable. for example:
initial value 1451657.994524
iter 10 value 47297.534905
iter 20 value -623478636.8236478
Then the iter 20 vlaue suddelnly changes to a negative value and in the end the error mesage is
2009 Nov 20
3
symbol in the plot
a graph question. Thanks a lot in advance.
I made two scatterplots on one graph (sigma vs. delta1, sigma vs. delta2)
(20 observations of delta1, delta2 and corresponding sigma) the x-axis is
sigma, the y-axis is either delta1 or delta2. I connected both scatterplots.
To seperate them, one curves is a line with circles, the other curve is a
line with squares on it.
I want to make a notation
2006 Jun 19
2
Nested variance-covariance matrix in Multilevel model
Dear R community,
I have trouble implementing a nested variance-covariance matrix in the
lme function.
The model has two fixed effects called End and logpgc, the response
variable is the logarithm to base 2 of Intensity ( log2(Intensity) )
and the random effects are called Probe and ProbeNo.
The model has the following nesting structure: A Pixel is nested within
the ProbeNo,the ProbeNo is
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
Dear all,
I tried running the following syntax but it keeps running for about 4 hours
and then i got the following errors:
Error in if (is.na(f0$objective)) { : argument is of length zero
In addition: Warning message:
In is.na(f0$objective) :
is.na() applied to non-(list or vector) of type 'NULL'
Here is the syntax itself:
library('nloptr')
library('pracma')
#
2012 Mar 24
1
Solving the equation using uniroot
Hello all,
I was going to solve (n-m)! * (n-k)! = 0.5 *n! * (n-m-k)!
for m when values of n and k are provided
n1<-c(10,13,18,30,60,100,500) # values of n
kx<-seq(1,7,1); # values of k
slv2<-lapply(n1,function(n){
slv1<-lapply(kx,function(k){
lhs<-function(m)
{
2005 Nov 17
3
loess: choose span to minimize AIC?
Is there an R implementation of a scheme for automatic smoothing
parameter selection with loess, e.g., by minimizing one of the AIC/GCV
statistics discussed by Hurvich, Simonoff & Tsai (1998)?
Below is a function that calculates the relevant values of AICC,
AICC1 and GCV--- I think, because I to guess from the names of the
components returned in a loess object.
I guess I could use
2001 Dec 04
3
factorial() not here (PR#1194)
Version 1.3.1 (2001-08-31)
factorial() is not in R. It is in S-Plus with the definition
factorial <- function(n) gamma(n + 1)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not
2006 Dec 14
3
Model formula question
Hi all,
I'm not familiar with R programming and I'm trying to reproduce a
result from a paper.
Basically, I have a dataset which I would like to model in terms of
successive increments, i.e. (y denote empirical values of y)
y_1 = y1,
y_2 = y1 + delta1,
y_3 = y1 + delta1 + delta2.
...
y_m = y1 + sum_2^m delta j
where delta_j donote successive increments in the y-values, i.e.
delta
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
I'm solving 4 complex equations simultaneously. Code is below. The code
returns only zero's for the solution though there should also be a non-zero
result. I'm pretty confident that the equations are correct because they
are straight from a published paper and I checked them pretty thoroughly.
The parameter values I used are from the published paper as well. Any
suggestions for how
2008 Jan 06
2
how to get residuals in factanal
In R factanal output, I can't find a function to give me residuals e.
I mannually got it by using x -lamda1*f1 -lamda2*f2 - ... -lamdan*fn, but the e
I got are not uncorrelated with all the f's.
What did I do wrong? Please help.
Yijun
____________________________________________________________________________________
Be a better friend, newshound, and
2010 May 18
1
proportion of treatment effect by a surrogate (fitting multivariate survival model)
Dear R-help,
I would like to compute the variance for the proportion of treatment
effect by a surrogate in a survival model (Lin, Fleming, and De
Gruttola 1997 in Statistics in Medicine). The paper mentioned that
the covariance matrix matches that of the covariance matrix estimator
for the marginal hazard modelling of multiple events data (Wei, Lin,
and Weissfeld 1989 JASA), and is implemented
2018 Aug 07
2
[R-pkg-devel] Run garbage collector when too many open files
Dear Uwe,
(When replying to your message, I sent the reply to r-devel and not
r-package-devel, as Martin Meachler suggested that this thread would be
a better fit for r-devel.)
Thanks. In the example below I used rm() explicitly, but in general
users wouldn't do that.
One of the reasons for the large number of file handles is that
sometimes unnamed temporary objects are created. For
2018 Aug 07
1
Run garbage collector when too many open files
Dear Luke,
Thanks. See below
On 07-08-18 17:07, luke-tierney at uiowa.edu wrote:
> In R 3.5 and later you should not need to gc() -- that should happen
> automatically within the connections code.
Could you elaborate on what has changed in R 3.5? As far as I can tell
my problem also occurs in R 3.5 (my computer is still on 3.4.4; but I
assume the solaris CRAN machine isn't). And
2011 May 09
1
Stirlings Approximation
I have some big combinations like:
4444444444444444444444444444 choose 784645433
Can R compute these?
Is there any package that does stirlings approximation in R?
--
Thanks,
Jim.
[[alternative HTML version deleted]]