s-news
[Top] [All Lists]

error in val.prob function - group=T

To: s-news@lists.biostat.wustl.edu
Subject: error in val.prob function - group=T
From: Carlos Davidson <cdavidson@csus.edu>
Date: Mon, 31 May 2004 14:37:50 -0700
Dear S list

When I run val.prob with the group=T option I get a warning message saying "NAs generated in: log(x)". When I do not use the group=T option I do not get an error. Otherwise the output looks fine. Below is code and output that generates the warning message. fits2 is the "b" array of probabilities, and ramumain01 is the "y" array of 0 or 1 values. When I I thought the problem might be that my probabilities go down to near zero, but see code and output below of an example where the minimum probability is 0.12 and I still get the same warning message. I can run the example in the val.prob documentation without any problems. And I can adjust the example sample size to match mine and run either the example b array with my y array or vice versa without problems - only when I use both my b and y arrays do I get an error. And I get this same error with two completely different datasets! Any suggestions?


> summary(fits2)
      Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
 0.0000000 0.0203278 0.0584008 0.1327387 0.1728797 0.8852888
> summary(ramumain01)
   Min. 1st Qu. Median   Mean 3rd Qu.   Max.
 0.0000 0.0000  0.0000 0.1327 0.0000  1.0000
> valobj <- val.prob(fits2, ramumain01)
> valobj <- val.prob(fits2, ramumain01, group = T)
Warning messages:
  NAs generated in: log(x)



# here with manipulated fits values so none near zero.

> fits3 <- (fits2 + 0.2) * 0.6
> summary(fits3)
      Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
 0.1200000 0.1321967 0.1550405 0.1996432 0.2237278 0.6511733
> valobj <- val.prob(fits2, ramumain01, group = T)
Warning messages:
  NAs generated in: log(x)

Thanks!!

Carlos

***************************
 
Carlos Davidson
 
Department of Environmental Studies
California State University, Sacramento
6000 J Street
Sacramento, CA 95819-6001
 
Phone: (916) 278-6063
Fax: (916) 278-7582
Email: cdavidson@csus.edu
 
Web: www.csus.edu/indiv/d/davidsonc
<Prev in Thread] Current Thread [Next in Thread>
  • error in val.prob function - group=T, Carlos Davidson <=