Displaying 20 results from an estimated 11000 matches similar to: "[R] cut with infinite values -> NA (PR#1694)"
2002 Jun 20
1
cut with infinite values -> NA
I am doing work on changes in establishment sizes and came across
behavior that is quite understandable and easily worked around but
a little surprising. On R 1.5.1 on Debian unstable (see below for
R.version output):
> cut.off <- c(-Inf, 0, Inf)
> x <- c(-Inf, -10, 0, 10, Inf)
> is.numeric(x)
[1] TRUE
> is.double(x)
[1] TRUE
> # but
> cut(x, cut.off, include.lowest=T)
[1]
2002 May 20
1
suggestion for example for base:naresid
Dear list:
since it took me a little while to figure out how to make use of naresid, I thought that
the below R code might be useful as an example on the help page.
Regards,
Markus
# generate some data
x1 <- runif(20)
y <- 10 + 5*x1 + rnorm(20)
summary(lm.0 <- lm(y ~ x1))
# append some NA's to y
y <- c(y, rep(NA, 5))
# generate some further x1s
x1 <- c(x1, runif(5))
#
2001 Aug 29
1
suggestion for example for base:naresid
Dear list:
since it took me a little while to figure out how to make use of naresid, I thought that
the below R code might be useful as an example on the help page.
Regards,
Markus
# generate some data
x1 <- runif(20)
y <- 10 + 5*x1 + rnorm(20)
summary(lm.0 <- lm(y ~ x1))
# append some NA's to y
y <- c(y, rep(NA, 5))
# generate some further x1s
x1 <- c(x1, runif(5))
#
2005 Feb 14
0
using poly in a linear regression in the presence of NA fails (despite subsetting them out)
I ran into a to me surprising result on running lm with an orthogonal
polynomial among the predictors.
The lm command resulted in
Error in qr(X) : NA/NaN/Inf in foreign function call (arg 1)
Error during wrapup:
despite my using a "subset" in the call to get rid of NA's.
poly is apparently evaluated before any NA's are subsetted out
of the data.
Example code (attached to
2002 Jul 17
1
editing Sweave files in xemacs with ess (noweb), auctex and reftex
I am having some trouble getting reftex, in particular the bibtex
related features, to work properly in xemacs when editing text in Sweave
files. I have added
(defun Rnw-mode ()
(noweb-mode)
(if (fboundp 'R-mode)
(setq noweb-default-code-mode 'R-mode)))
(add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode))
(add-to-list 'auto-mode-alist
1999 Nov 25
0
tapply and weighted.mean
I am trying to use tapply to estimate the average wage in a set of
Year*Education cells using sampling weights, as well as some other
other statistics using the weights). I am having trouble trying
to figure out how to pass the weights to the function, using:
> tapply(wage,list(Educc,Year),weighted.mean, w=weight)
whieh produces warnings of the type:
3: longer object length
is not a
1999 Sep 02
1
unresolved symbols in growth and repeated libraries
I am having trouble using Jim Lindsey's libraries because of unresolved
symbols. I am currently using R 0.65.0, but had this problem in earlier
releases as well. I have a RedHat 6.0 Linux on i386 and use egcs
(upgraded to that distributed with rawhide, after first failures with
the libraries):
egcs-g77-1.1.2-19
egcs-1.1.2-19
Installation of the libraries works but on loading
>
2000 Jun 16
0
glm under R versions 1.0.1 and 1.1.0
I have fitted a number of models with receipt of social assictance
(toim1) during a year (values 0 or 1) with a number of covariates.
The data include sampling weights which I use in the models. Using the
exact same data, glm() under 1.0.1 and 1.1.0 give different results in
many (but not all) of the models. I have re-installed 1.0.1 to check
this and I found now mention in the NEWS file that
2001 May 18
1
NAs in chron objects
Dear All:
I am having some trouble with date variables when NAs are present. The
following example illustrates (see below for output of version):
> library(chron)
> minor.test <- c( "NA", "NA", "1988-02-08",
+ "1988-02-08", "NA", "1987-11-23", "1988-09-03", "1991-10-15",
+
1998 May 06
1
R-beta: adjusting y-axis scale with multiple lines in plot
Hello --
I am plotting multiple densities in a single plot. If the max of a new
density (added with 'lines()') is sufficiently larger than that of the
one first plotted (using 'plot()'), the new density is cut or
trucated off of the figure. Is there a simple way of adjusting the
yscale after all lines have been added?
Or is the procedure to be used to first estimate all
2005 Feb 15
3
using poly in a linear regression in the presence of NA f ails (despite subsetting them out)
This smells like a bug to me. The error is triggered by the line:
variables <- eval(predvars, data, env)
inside model.frame.default(). At that point, na.action has not been
applied, so poly() ended being called on data that still contains missing
values. The qr() that issued the error is for generating the orthogonal
basis when evaluating poly(), not for fitting the linear model itself.
2005 Feb 15
3
using poly in a linear regression in the presence of NA f ails (despite subsetting them out)
This smells like a bug to me. The error is triggered by the line:
variables <- eval(predvars, data, env)
inside model.frame.default(). At that point, na.action has not been
applied, so poly() ended being called on data that still contains missing
values. The qr() that issued the error is for generating the orthogonal
basis when evaluating poly(), not for fitting the linear model itself.
2002 Oct 21
1
dist() {"mva" package} bug: treats +/- Inf as NA
Vince Carey found this (thank you!).
Since the fix to the problem is not entirely obvious, I post
this to R-devel as RFC:
help(dist) says:
>> Missing values are allowed, and are excluded from all computations
>> involving the rows within which they occur. If some columns are
>> excluded in calculating a Euclidean, Manhattan or Canberra
>> distance, the sum is
2005 Nov 17
1
anova.gls from nlme on multiple arguments within a function fails
Dear All --
I am trying to use within a little table producing code an anova
comparison of two gls fitted objects, contained in a list of such
object, obtained using nlme function gls.
The anova procedure fails to locate the second of the objects.
The following code, borrowed from the help page of anova.gls,
exemplifies:
--------------- start example code ---------------
library(nlme)
##
2019 Dec 09
0
What should dnorm(0, 0, -Inf) return?
>>>>> peter dalgaard
>>>>> on Sun, 8 Dec 2019 12:11:50 +0100 writes:
> Yes, that looks like a bug and an easily fixable one too.
agreed.
> However, I spy another issue: Why do we check the
> !R_FINITE(x) && mu == x before checking for sd < 0 ? The
> difference is whether we
> return ML_NAN; or ML_ERR_return_NAN;
2019 Dec 08
2
What should dnorm(0, 0, -Inf) return?
Yes, that looks like a bug and an easily fixable one too.
However, I spy another issue: Why do we check the !R_FINITE(x) && mu == x before checking for sd < 0 ? The difference is whether we
return ML_NAN;
or
ML_ERR_return_NAN;
but surely negative sd should always be an error?
I'd be inclined to do
if (sigma < 0) ML_ERR_return_NAN;
if(!R_FINITE(sigma)) return R_D__0;
2017 Feb 09
3
Ancient C /Fortran code linpack error
> > On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
> >
> > In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this:
> >
> > F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info);
> > if (*info == 0){
> >
2017 Feb 10
0
Ancient C /Fortran code linpack error
Thanks to all who answered my third question. I learned something, but:
On 2017-02-09 17:44, Martin Maechler wrote:
>
>>> On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>>>
>>> In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this:
2003 May 16
0
glmmPQL, NA/NaN/Inf in foreign function call (arg 3)
Dear all,
I try to fit a glmmPQL on a huge data with 384189 individuals id=1:384189:
working in 1520 establishments est:1:1516. The minimum number of individuals
in every establishment is 30.
This works for a subsample excluding establishemnet cells smaller than 100,
but fail when we include smaller cells:
R> summary(glmmPQL(count ~
+ I( age-ave(age,est) )* ave(age,est) +
+ I(
2017 Feb 10
1
Ancient C /Fortran code linpack error
> On 10 Feb 2017, at 14:53, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>
> Thanks to all who answered my third question. I learned something, but:
>
> On 2017-02-09 17:44, Martin Maechler wrote:
>>
>>>> On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>>>>
>>>> In my package 'glmmML'