[R] Possible overfitting of a GAM

2008-02-16 Thread Thomas L Jones, PhD
, things went awry. (Please see http://tinyurl.com/38ej2t ) There are three curves, seemingly the fitted curve and the curves for plus and minus two standard errors. The shapes seem okay, but there are large errors in the y values. Question: Have I overfitted the data? Feedback? Tom Thomas L

[R] Writing a file to the disk

2007-12-11 Thread Thomas L Jones, PhD
I am having difficulty writing the code for the following operation: I have a numeric vector pred_out of length 156. (N = 156). Under Windows XP, I need to write it to the disk in text format. Perhaps some kind soul would provide the code fragment. The file name is sheet_vec.txt. Please see [1]

[R] Function to tell you how an object is put together

2007-12-10 Thread Thomas L Jones, PhD
Question: Suppose I have an arbitrary object. Is there a function which will accept the object as an argument and sort of give the format of the object, how it is put together, etc.? The analysis would include the attributes and the names of the attributes. Also, things like whether or not the

[R] Problem with a global variable

2007-12-03 Thread Thomas L Jones, PhD
From: Thomas Jones I have several user-defined functions. As is standard practice, I am defining a logical vector named idebug in order to control debugging printouts. For example, if idebug [1] has the value TRUE, such-and-such debugging printouts are enabled. After the function works, some or

[R] Communicating from one function to another

2007-11-26 Thread Thomas L Jones, PhD
all" of the variables, with two functions which get all of them and set all of them. The function calls may be thought of as an upside down tree. I want to be able to communicate from any node to any other node. Your advice? Tom Thomas L. Jones, PhD, Computer Science

[R] Problem with environments

2007-11-22 Thread Thomas L Jones, PhD
tion 1: Is the idea of using such a variable viable at all? In some communities, it would be called a "free variable." Question 2: Is the list correct? If not, how does one build it correctly? Question 3: How do you tell it NOT to mask the variable i by .GlobalEnv, whatever that is? Y

[R] Naming elements of a list

2007-11-22 Thread Thomas L Jones, PhD
I have a numeric vector of lenth 1. I am trying to use it inside a function just by giving its name, rather than specifying it as an argument to the function. I am aware that there is an attach function which you need to call. The attach function will accept a list. However, I don't seem to be able

[R] Problems with NA's

2007-11-19 Thread Thomas L Jones, PhD
Difficulty handling NA's: Assume that I have a numeric vector y. For simplicity, assume that it has 10 elements. Assume that the third element has the value NA. I give it the following: NA_test <- function (){ y <- numeric (10) y [3] <- NA if (y [3] != NA){(print ("no")} print ("Leaving NA_test")

[R] Fw: Creating a barplot--advice needed

2007-11-05 Thread Thomas L Jones, PhD
Subject: Creating a barplot--advice needed > Advice needed: I am preparing a computer program to do a barchart. Advice > needed: Should I learn the lattice package, or try to? As a > non-statistician, much of the terminology is unfamiliar to me. "grouping > variable," "object of class trelli

[R] Format of a data frame

2007-10-21 Thread Thomas L Jones, PhD
The goal is to smooth a scatterplot using the LOESS locally weighted regression program and a gam. There are 156 points. Thus x can have the value 1, or 2, etc., up to a maximum of x = 156. The y values are random, with a Poisson distribution, or the next thing to it. After reading in the data,