[R] How does predict.lm work?

2008-09-09 Thread Williams, Robin
Hi, Please could someone explain how this element of predict.lm works? >From the help file ` newdata An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. ' Does this dataframe (newdata) need to have the same variable names as

Re: [R] write dataframes

2008-09-09 Thread Williams, Robin
Hi, Just a thought. You wrote: ob1<-object1$ORF ob2<-object2$ORF and then use cbind like, HG<-cbind(on1,ob2) but there is an error. Is there any other function I can use? If you copied and pasted this from R, then your problem is Hg <- cbind(on1,ob2) You mean Hg <- cbind(ob1,ob2) So perh

[R] Saving functions

2008-09-08 Thread Williams, Robin
Hi, Appologies for the simple nature of this question, I am unable to find the answer in manuals (EG and introduciton to R). I have written a function in a text editor and saved it with an .R extension. It is saved in my working directory. How can I run it, do I need to use source? If so, how

Re: [R] Orthogonalization algorithms

2008-09-05 Thread Williams, Robin
Please ignore this, it appears I have found what I'm looking for in the far package. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Williams, Robin Sent: F

[R] Orthogonalization algorithms

2008-09-05 Thread Williams, Robin
Hi, I have eight vectors that I would like to orthogonalize preferably using R. The vectors are of considerable length, however due to their nature I know they satisfy the conditions needed to apply the Gram-Schmidt algorithm. Before I embark on some R coding, I wanted to check that there is no

Re: [R] saving an object

2008-09-04 Thread Williams, Robin
?save I assume you can connect to it from within the script, presumably by supplying the path of the object to the appropriate argument in your script. I'm no expert though. HTH, Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original Message- From:

[R] Stepwise

2008-09-04 Thread Williams, Robin
Hi, Is there any facility in R to perform a stepwise process on a model, which will remove any highly-correlated explanatory variables? I am told there is in SPSS. I have a large number of variables (some correlated), which I would like to just chuck in to a model and perform stepwise and see what

[R] Coefficient of skewness

2008-09-04 Thread Williams, Robin
Hi, Is there a function in R to calculate the coefficient of skewness of some data? I had expected there to be one, but can find no information about it. Thanks for any pointers. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] [[alternative HTML versio

Re: [R] R update

2008-09-04 Thread Williams, Robin
Not sure if you can do it from within R, but if not surely you can just go to the website www.r-project.org Download and install the latest version and remove older versions if you wish. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original Message-

[R] Normality test

2008-09-03 Thread Williams, Robin
Hi, I am looking for a normality test in R to see if a vector of data I have can be assumed to be normally distributed and hence used in a linear regression. > help.search("normality test") suggests the Shapiro test, ?shapiro.test. Now maybe I am interpreting things incorrectly (as is usually the

[R] Weighted Regression

2008-08-29 Thread Williams, Robin
Hello, Firstly let me explain that the nature of what I want to do is actually beyond my statistical knowledge, having only taken a second year university stats course last year. Therefore I may have missed the statistical essence of what I want to do as well as my lack of ability to do it in R.

Re: [R] I need to change from character to numeric?

2008-08-29 Thread Williams, Robin
There was a very informative thread on this list only a week or so ago (I started it!). If you're reading from a table or a csv file, see the colClasses argument. Otherwise see ?as.numeric. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] -Original Message

[R] Singularity?

2008-08-28 Thread Williams, Robin
Hi all, When using lm to model a response with 8 explanatory variables, one of the variables is not defined due to "singularities". I have checked the csv file from which the data come, there are no na's in the dataset, etc. What should I be looking for in this variable to correct the problem?

[R] Renaming objects

2008-08-28 Thread Williams, Robin
Hi, Is there any quick and easy way to rename a number of objects, without having to rename each one individually and then remove the old one? And if so, is there anything I can do to adjust the associated comments accordingly? Thanks for any help, Robin Williams Met Office summer intern - Heal

[R] Very confused with class

2008-08-21 Thread Williams, Robin
Hi all, I am very confused with class. I am looking at some weather data which I want to use as explanatory variables in an lm. R has treated these variables as factors (i.e. with different levels), whereas I want them treated as discretely measured continuous variables. So I need to reassign t

[R] Using lag

2008-08-18 Thread Williams, Robin
Dear all, I am having difficulties using the seemingly-simple function lag. I have a dataframe with several weather variables (maxitemp, windspeed, rainfall etc), and the response variable (admissions). The dataset is fairly large (1530 observations). I simply want to model the response again

[R] Bizarre - R crashes on merge

2008-07-30 Thread Williams, Robin
Hi all, I have a large data.frame, 1530 observation with 6 columns. I want to merge a 7th column, a transformation of the response variable (hospital admissions), namely trans<-sqrt(copd$admissions+0.25) trans<-data.frame(trans) And now when I do copd2<-merge(copd,trans) (copd being my origina

[R] Just 2 more questions - for now!

2008-07-24 Thread Williams, Robin
Hi all, Thanks for the help with my previous post. I have just two more questions for the minute. I think I said in a previous post that I like to use the terminal, i.e. run rterm.exe. On exiting the terminal, I am asked if I want to save the workspace. If I hit y (yes), the workspace is just

[R] Is there an equivalent * operator?

2008-07-24 Thread Williams, Robin
Hi all, Is there an equivalent to the general * operator in R, where * can represent any character? I have a dataset, one column being date, date ranging between April-September, 97-06. I would like to be able to acquire the data for a specific month, say September, so that I can take average t

[R] Ignore previous emails

2008-07-22 Thread Williams, Robin
Please ignore my previous message, I have solved the problem by altering the filename. I appologise for cluttering this already-busy list. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] [[alternative HTML version deleted]] __

[R] Opening files from R terminal - appologies

2008-07-22 Thread Williams, Robin
Dear all, I appologise for cluttering up the list with such a basic question, however I have been unable to find the answer I want (possibly through my poor usage of the R help system). As I am visually impaired and using assistive technology, I think I would prefer to use R from the terminal m

Re: [R] Subsetting data by date

2008-07-21 Thread Williams, Robin
] -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 3:26 PM To: Williams, Robin Cc: R-help@r-project.org Subject: Re: [R] Subsetting data by date Continuing on, to just get points from May to Sep mo <- as.numeric(format(time(z),

Re: [R] Subsetting data by date

2008-07-21 Thread Williams, Robin
Forecasting [EMAIL PROTECTED] -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 3:26 PM To: Williams, Robin Cc: R-help@r-project.org Subject: Re: [R] Subsetting data by date Continuing on, to just get points from May to Sep mo <- as.nume

[R] Subsetting data by date

2008-07-21 Thread Williams, Robin
Hi all, Firstly I appologise if this question has been answered previously, however searching of the archives and the internet generally has not yielded any results. I am looking in to the effects of summer weather conditions (temperature, humidity etc), on the incidences of a breathing dis