Skip to content

(no subject)

3 messages · Alicia Lopez, Uwe Ligges, Duncan Murdoch

#
I would be gratefulf if anybody can help me with this problem.  I have not
a experience with R 
language, actually this is my first job with it :

I have write some instructions for acomplish a simulation, and I have 36
conditions 
with 1000 iterations each one . The program runs without problems, but in
the 19 nth 
condition  gives and  error message (after running   some iterations of
this condition)   
is:

"Error in var(x, na.rm = na.rm) : missing observations in cov/cor"

Somebody would give me any clue about the origin of this error?
There is any probability  that the origin of the problem is  the scarcitie
of resources?
(  I don?t understand how is possible a programming error).

Any help will be welcome.




---------------------------------------------------
ALICIA L?PEZ J?UREGUI
 

   DEPARTAMENTO DE PSICOLOGIA SOCIAL Y METODOLOGIA
   FACULTAD DE PSICOLOGIA 
   Avda. de Tolosa, 70
   20018 DONOSTIA (SPAIN)

         TEL.: 943 / 018340   
         E-MAIL: psplojaa at sc.ehu.es
#
Alicia Lopez wrote:

            
So, presumably by former calculations, you got NAs in some data 
structure for which the variance is calculated.
You have to debug your code, if you don't know where the NAs come from.

Uwe Ligges
#
On Mon, 02 Jun 2003 12:34:47 +0200, you wrote:

            
This is unlikely to be due to a scarcity of resources; that should
give a different error message.

What the message says is that at some point you (or a function you
call) are calling the var() function and passing it NA values where it
doesn't want them.  You can use the traceback() function after the
error to see where the call occurs. 

If the NA values should be removed, then you need to make sure that
na.rm = TRUE when this call occurs.  If the NA values shouldn't be
there, then you need to find why they are, and fix your code.

Duncan Murdoch