[R] Strange Matrix Multiplication Behaviour

2004-10-04 Thread Wayne Jones
minor9.1 year 2004 month06 day 21 language R Regards Wayne Jones KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England Company Registration Number 2800886 Tel

RE: [R]

2004-09-22 Thread Wayne Jones
The following function will do it. But be warned it will only work if all the input strings are lower case. Make.To.Upper.Case-function(my.string){ paste(LETTERS[match(strsplit(my.string,)[[1]],letters)],collapse=) } Make.To.Upper.Case(jhjhaskjdakdsj) [1] JHJHASKJDAKDSJ -Original

RE: [R] t test problem?

2004-09-22 Thread Wayne Jones
Hi Kan Lui, I've had a quick look at the data. The logged data seems reasonably nicely distributed (roughly symmetrical + equal variance). Indeed the y variable passed the (very strict) shapiro.test for normality. However the main problem is that I do not get the same results as you for the

RE: [R] S-PLUS and R

2004-09-21 Thread Wayne Jones
Save the excel file as a .csv file. The read about help(read.csv) Regards Wayne -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 21 September 2004 16:41 To: [EMAIL PROTECTED] Subject: [R] S-PLUS and R Hello, How do I import data from Excel onto R? I am

RE: [R] newbie needs help using R as solver

2004-09-16 Thread Wayne Jones
This is a linear programming problem. Although I am not sure what your objective function is!! Check out the R package linprog -Original Message- From: Andrej Uduc [mailto:[EMAIL PROTECTED] Sent: 16 September 2004 10:29 To: [EMAIL PROTECTED] Subject: [R] newbie needs help using R as

RE: [R] newsgroup on R

2004-09-02 Thread Wayne Jones
Check out: http://cran.r-project.org/doc/Rnews/ -Original Message- From: Bin Jiang [mailto:[EMAIL PROTECTED] Sent: 02 September 2004 12:09 To: [EMAIL PROTECTED] Subject: [R] newsgroup on R HI, I wonder if there is a newsgroup on R available, instead of emaillist which I have to

RE: [R] integrate function

2004-08-26 Thread Wayne Jones
be interested in http://www.stats.gla.ac.uk/~simon/simon/ddefit.html Regards Wayne Jones -Original Message- From: Ronaldo Reis Jr. [mailto:[EMAIL PROTECTED] Sent: 25 August 2004 21:02 To: R-Help Subject: [R] integrate function Is possible to integrate this diferential equation: dN/dt

RE: [R] How to select a whole column? Thanks!

2004-08-03 Thread Wayne Jones
What about: my.df-data.frame(x=rnorm(20),y=rep(0,20),z=rep(1,20)) my.df[,!apply(my.df,2,sd)==0,drop=F] This uses the fact that a column with eaqual values has a standard deviation of 0. Regards Wayne -Original Message- From: Jinsong Zhao [mailto:[EMAIL PROTECTED] Sent: 03

RE: [R] computing sum of indicator variables

2004-07-26 Thread Wayne Jones
What about x - c(2,4,7) out-rep(0,max(x)) out[x]-1 Regards Wayne -Original Message- From: Stefan Böhringer [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 09:46 To: R Help Subject: [R] computing sum of indicator variables My problem is as follows: i is a list of integers of variable

RE: [R] Testing autocorrelation heteroskedasticity of residuals in ts

2004-07-21 Thread Wayne Jones
Hi Vito, I would treat the residuals as a time series. You can fit an arima model to the residuals. For example: data(nottem) temp-stl(nottem, per) my.arima-arima(temp$time.series[,3], order=c(1,0,0), include.mean = FALSE) my.arima tsdiag(my.arima) If the ar1 term is significant then the

[R] converting character strings to eval

2004-07-19 Thread Wayne Jones
Hi there fellow R-users, I'm stuck on this seemingly trivial problem. All I want to coerce a character string into a command. For example: x-rnorm(20) y-rnorm(20) str-lm(y~x) I want to evaluate the str command. I have tried eval(as.expression(str)) But it doesn't seem to work. I am

RE: [R] converting character strings to eval

2004-07-19 Thread Wayne Jones
Thanks folks, That's exactly what I needed. Thanks for the speedy replies. Regards Wayne -Original Message- From: Dimitris Rizopoulos [mailto:[EMAIL PROTECTED] Sent: 19 July 2004 15:49 To: Wayne Jones Cc: [EMAIL PROTECTED] Subject: Re: [R] converting character strings to eval Hi

[R] k nearest neighbor prediction

2004-07-08 Thread Wayne Jones
Hi there fellow R-users, Does anyone know if there is a package for k nearest neighbours prediction as opposed to classification? I have found the package knncat but can't see a way to adjust it to predict a continuous variable. Any help would be great, Regards Wayne Jones KSS Ltd

[R] k nearest neighbours

2004-06-22 Thread Wayne Jones
Hi there fellow R-users, Does anyone know of a function which does exactly what knearneigh{spdep} (finds the k nearest neighbours) does in the package spdep but for more than 2D data? Regards Wayne KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England

RE: [R] frequencies

2004-06-21 Thread Wayne Jones
See ?hist For example hist(rnorm(100),plot=F,breaks=-3:3)$counts Regards Wayne -Original Message- From: Silvia Kirkman [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 14:01 To: [EMAIL PROTECTED] Subject: [R] frequencies Hi I have a set of fish lengths (cm) which I'd like to have

[R] Clustering Categorial and Continuous Variables

2004-06-10 Thread Wayne Jones
Hi there fellow R users, R has many different clustering packages (e.g. mclust,cluster,e1071). However, can anyone recommend a method to deal with data sets that contain categorial and continuous variables? Regards Wayne KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street

[R] market-basket analysis in R

2004-06-09 Thread Wayne Jones
Hi there fellow R-users, Does anyone know if there exists a package for associated rules data mining (market basket analysis) in R. I have tried searching CRAN but with no luck. Regards Wayne KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England

[R] Venn diagrams

2004-05-26 Thread Wayne Jones
Hello there, Does anyone know how to plot venn diagrams in R? Ive searched the mail archive lists but to no avail. Regards, Wayne Jones KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England Company Registration Number 2800886 Tel: +44 (0) 161 228 0040

[R] loess and as.POSIXct

2004-05-07 Thread Wayne Jones
Hi there fellow R-users, I have just upgraded to R version 1.9.0 from R version 1.7.1 for Windows. Im trying to use the loess smoother where the X-variable is an as.POSIXct variable. The following works fine with R1.7.1 but not with R1.9.0. Here is the example:

RE: [R] How does the lm() function work?

2004-05-07 Thread Wayne Jones
?step -Original Message- From: Phillip Good [mailto:[EMAIL PROTECTED] Sent: 07 May 2004 15:19 To: [EMAIL PROTECTED] Subject: [R] How does the lm() function work? Does the lm() function use forward, backward, stepwise or some other method of multivariable regression? Where can I

[R] lme correlation structure error

2004-04-22 Thread Wayne Jones
Hi there fellow R-users, I am trying to follow an example of modelling a serial correlation structure in the textbook Mixed Effects Model in S and Splus. However, I am getting some very odd results. Here is what I am trying to run: library(nlme) data(Ovary)

[R] GARCH

2004-04-02 Thread Wayne Jones
Hi there fellow R-Users, Can anyone recommend a good book on the theory and practice of applying GARCH models. Also, does any one know of any R related subject material in addition to library(tseries). Regards Wayne Dr Wayne R. Jones Senior Statistician / Research Analyst KSS Limited St

RE: [R] Problems with optimize

2004-03-29 Thread Wayne Jones
If indeed your error space is pitted with local minima then I suggest you might try a method called bootstrap restarting to avoid these spurious local minimas. The paper was authored by Simon Wood and can be found here http://www.stats.gla.ac.uk/~simon/simon/papers/bsfit.pdf -Original

RE: [R] regression problem

2004-03-26 Thread Wayne Jones
Consider a regression equation say:- Y=a+b1*X1+b2*X2+b3*X3 if all the regression coefficients have to sum to 0 then a+b1+b2+b3=0 i.e. b3=-a-b1-b2 Substituting this back into the regression equation we get Y=a(1-X3)+b1(X1-X3)+b2(X2-X3) All you need to do then is to create the new

[R] Job Vacancy

2004-03-24 Thread Wayne Jones
www.kssg.com a pricing consulatancy based in Manchester (UK) are seeking an experienced statistical analyst. Candidates must be eligible to work in the EU. If you are interested please send an updated CV to [EMAIL PROTECTED] . Company Overview KSS is a leading provider of pricing and revenue

RE: [R] logistic regression with temporal correlation

2004-03-18 Thread Wayne Jones
Hello, You can either use nls and add weights see ?nls. Or use a generalized linear model and also change the weights. se ?glm Regards Wayne -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 08:37 To: [EMAIL PROTECTED] Subject: [R] logistic

RE: [R] don't stop when error occurs

2004-03-18 Thread Wayne Jones
Look up ?try Regards Wayne -Original Message- From: pastaska1934 [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 14:36 To: [EMAIL PROTECTED] Subject: [R] don't stop when error occurs hi, i'm doing some bootstraping on a data set, using kmeans for each bootstrap, i mean i do a loop(200

RE: [R] rate of change

2004-03-16 Thread Wayne Jones
?fdHess Check out the function fdHess in the library(nlme). It numerically calculates the gradient and Hessian of a given function. Regards Wayne -Original Message- From: Fred J. [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 03:20 To: r help Subject: [R] rate of change Hello I am

RE: [R] dsn

2004-03-08 Thread Wayne Jones
Hi If you are using windows then do this: Basically you need to add your oracle database as an ODBC data source. Control Panel - Administrative tools - Data Sources (ODBC) Select the System DSN tab and then Add. Select which type of Data source i.e. Oracle database. Then follow the

RE: [R] How to repeat a procedure

2004-02-18 Thread Wayne Jones
The command ?apply will easily get row means/vars (or col means/vars) e.g. my.mat-matrix(rnorm(144),12) my.mat apply(my.mat,1,mean,na.rm=T) apply(my.mat,1,var,na.rm=T) The functions ?rbind and ?cbind will help you add rows or columns to matrices or data frames Enjoy Wayne -Original

[R] Almost Ideal Demand System

2004-02-12 Thread Wayne Jones
Hi there fellow R users, Has anyone got an R example of applying an Ideal demand system, possibly using the library systemfit?? Thanks Wayne Dr Wayne R. Jones Senior Statistician / Research Analyst KSS Limited St James's Buildings 79 Oxford Street Manchester M1 6SS Tel: +44(0)161 609

RE: [R] R: lags

2004-02-10 Thread Wayne Jones
Try this for size: Not a very efficient way to do it though!!! Get.Random.Walk-function(){ length.walk-1000 rand.walk-rep(0,length.walk) for(i in 2:length.walk) { rand.walk[i]-rand.walk[i-1]+rnorm(1, mean=0, sd=1) } return(rand.walk) } plot(Get.Random.Walk()) -Original Message-

RE: [R] R: lags and plots

2004-02-03 Thread Wayne Jones
?lag.plot -Original Message- From: allan clark [mailto:[EMAIL PROTECTED] Sent: 03 February 2004 11:58 To: Rhelp Subject: [R] R: lags and plots Hi all I want to calculate certain lags of a time series and plot them simultaneously on a graph. can anyone help? KSS Ltd Seventh Floor

RE: [R] r: lm question

2004-01-05 Thread Wayne Jones
lm(y~x-1) -Original Message- From: allan clark [mailto:[EMAIL PROTECTED] Sent: 05 January 2004 09:31 To: [EMAIL PROTECTED] Subject: [R] r: lm question Hi all this is a silly question since i should know the answer. lm(y~x) perfroms linear regression with the intercept included.

[R] Week of the Year date conversion

2003-12-15 Thread Wayne Jones
Hello there fellow R-users, I have received some data which comes in the following format: example1-200301 The first 4 digits correspond to the year and the remaining 2 digits correspond to the week of the year. I have tried to convert this to a date by using strptime as follows:

[R] gls with serial correlation

2003-11-21 Thread Wayne Jones
Hello there fellow R users, Im trying to fit a gls model to data which has serial correlation in the errors e(t)=p*e(t-1). However I dont seem to be having much luck in erradicating the autocorrelation in the residuals. I have created the following example. library(nlme) x-rnorm(100)

[R] Correction for first order autocorrelation in OLS residuals

2003-11-19 Thread Wayne Jones
Hi there fellow R-users, Can anyone tell me if there exits an R package that deals with serial correlation in the residuals of an lm model. Perhaps, using the Cochrane Orcutt or Praise Wilson methods? Thanks, Wayne Dr Wayne R. Jones Senior Statistician / Research Analyst KSS Limited St

[R]: Prediction interval for a Gaussian family log-link model

2003-10-22 Thread Wayne Jones
Hi there fellow R-users, Can anyone tell me how to build a prediction interval for a gaussian log-link model for the reponse variable?? I can find the standard error of the predictions but I cant seem to find the prediction interval. Is there a way I can calculate the prediction interval from

RE: [R] Making R packages

2003-09-09 Thread Wayne Jones
Try adding C:\Perl\bin\; to your path variable. -Original Message- From: Gattuso, Jean-Pierre [mailto:[EMAIL PROTECTED] Sent: 09 September 2003 13:40 To: [EMAIL PROTECTED] Subject: [R] Making R packages Hi: I am posting this message for a colleague who has a lot of trouble to build

[R]: RODBC column length255

2003-09-04 Thread Wayne Jones
Hello there fellow R-users, I am using the RODBC functionality to query a database. I am trying to read in a columns of strings which have a character field lengths greater than 255. The data.frame that I recieve back from the RODBC query only contains the first 255 characters (the rest having

[R]: Creating a Package with Windows XP.

2003-09-02 Thread Wayne Jones
Hi there fellow R-Users, I am trying to use the package.skeleton to create my own package with R.1.7.1 on Windows XP Professional. I have followed the package.skeleton example and have downloaded the necessary files found at http://www.stats.ox.ac.uk/pub/Rtools/tools.zip. and perl5,

[R] FW: Creating a Package with Windows XP.

2003-09-02 Thread Wayne Jones
Hi there fellow R-Users, I am trying to use the package.skeleton to create my own package with R.1.7.1 on Windows XP Professional. I have followed the package.skeleton example and have downloaded the necessary files found at http://www.stats.ox.ac.uk/pub/Rtools/tools.zip. and perl5,

[R] RODBC with Windows XP

2003-08-06 Thread Wayne Jones
Hi R-Users, I have very recently switched from using R on windows 2000 to windows XP Professional. With XP I am having problems using the odbcConnect() command. I can use the command perfectly well until I close the database channel with the command odbcClose(channel). When I try and

[R] Sorting a data frame

2003-07-16 Thread Wayne Jones
Hi there R-Helpers, Does anyone know if it is possible to sort a dataframe? I.e. Sort alphabetically column 1 ( which has some reocurring elements) then sort alphabetically column2 but keeping the order of column 1 constant; much the same way that the sort function works in Excel. Regards,

RE: [R] rbind question

2003-07-08 Thread Wayne Jones
What about: matrix(rep(foo,2),ncol=length(foo),byrow=TRUE) -Original Message- From: David Andel [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 14:58 To: [EMAIL PROTECTED] Subject: [R] rbind question Hi I am trying to replicate a vector in n rows for comparison purposes with

[R] Na handing with time series objects

2003-04-04 Thread Wayne Jones
Hello All, Does anyone out there know a way to decompose time series objects with missing values. A simple na.omit will not work since it does not preserve the time differences between succesive observations. Thanks in advance, Wayne Dr Wayne R. Jones Statistician / Research Analyst KSS

[R] NA handling with time series objects

2003-04-04 Thread Wayne Jones
Hello All, Does anyone out there know a way to decompose time series objects with missing values. A simple na.omit will not work since it does not preserve the time differences between succesive observations. Thanks in advance, Wayne KSS Ltd A division of Knowledge Support Systems Group

[R] Na action with Lowess smoothing

2003-03-27 Thread Wayne Jones
Hi there, I cant seem to find a way for the lowess smoothing function to handle NA values. Can anyone help?? Regards, Wayne Dr Wayne R. Jones Statistician / Research Analyst KSS Group plc St James's Buildings 79 Oxford Street Manchester M1 6SS Tel: +44(0)161 609 4084 Mob: +44(0)7810 523

[R] Numeric Coerceing

2003-02-14 Thread Wayne Jones
Does anyone know how to coerce a numeric to a string?? THanks Wayne KSS Ltd A division of Knowledge Support Systems Group plc Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England Company Registration Number 2800886 (Limited) 3449594 (plc) Tel: +44 (0) 161 228 0040