Re: [R] Need help to estimate the Coef matrices in mAr

2006-09-04 Thread Spencer Graves
Have you tried 'RSiteSearch(multivariate autoregression, functions)'? This produced 14 hits for me just now, the first of which mentions a package 'MSBVAR'. Have you looked at that? If that failed, I don't think it would be too hard to modify 'mAr.est' to do what you want. If

[R] Subsetting vectors based on condition

2006-09-04 Thread Mahesh Krishnan
Hello, I have a question regarding subsetting of vectors. Here's an example of what I'm trying to do: vect.1 - c(76,195, 290, 380) vect.2 - c(63, 95, 133, 170, 215, 253, 285, 299, 325, 375) I would like to subset vect.2 so that it has the same length as vect.1, and its numbers are the first

[R] Command line cut-off

2006-09-04 Thread Björn Thalheim
Hi, I noticed that, when working with R on a command line, I cannot enter anything into the command line which is longer than 1023 characters. If I input sth longer, it'l be just cut off at this lenght, and a + will be presented to me on the command line. It's not as bad since I can copy'n'paste

[R] [R-pkgs] New forecasting bundle of packages

2006-09-04 Thread Rob Hyndman
v1.0 of the forecasting bundle of packages is now on CRAN and will propagate to mirrors shortly. The forecasting bundle of R packages provides new forecasting methods, and graphical tools for displaying and analysing forecasts. It comprises the following packages: * forecast: Functions

Re: [R] generating loglogistic distribution in R

2006-09-04 Thread nmi13
Hi Dear, Can someone please inform me on genreating random variables of Loglogistic, and PERT beta distributions? Thanks for your time and help, in advance. Regards, Murthy. __ R-help@stat.math.ethz.ch mailing list

Re: [R] Command line cut-off

2006-09-04 Thread Prof Brian Ripley
On Mon, 4 Sep 2006, Björn Thalheim wrote: Hi, I noticed that, when working with R on a command line, I cannot enter anything into the command line which is longer than 1023 characters. Actually, 1000 or 1022 or 1023 bytes, and it depends on your 'command line' (and you have not even told

[R] xlsReadWrite 1.0

2006-09-04 Thread Hans-Peter
The first version of xlsReadWrite has been uploaded to CRAN. -- WHAT IS IT? / R COMMANDS The package allows you to read and write Excel files natively. The supported Format is BIFF 8, i.e. Excel from version 97 up to 2003. • read.xls( file, colNames = TRUE, sheet = 1, type = data.frame, from =

[R] merge files after cor.test

2006-09-04 Thread jia ding
Dear All, Suppose I have 2 files: # first one : testid.csv A B C D E (id- read.table (testid.csv,col.name=c(id))) id 1 A 2 B 3 C 4 D 5 E # second file is the result file I calculate from cor.text, which shows the correlation coefficient. cor.value.t 1 2 3

Re: [R] my error with augPred

2006-09-04 Thread Petr Pikal
Hallo thank you for your response. I am not sure but maybe fixed effects cannot be set to be influenced by a factor to be able to use augPred. lob-Loblolly[Loblolly$Seed!=321,] set.seed(1) lob-data.frame(lob, x1=sample(letters[1:3], replace=T)) # add a #factor lob-groupedData(height~age|Seed,

[R] abline and plot(augPred) help

2006-09-04 Thread Petr Pikal
Dear all as I did not get any response on my post about abline and plot(augPred)) I try again. I hope I do not break some posting guide rules. I would try to contact package maintainer directly but there is stated to be R-core people, so I feel R-help list shall be OK. I need to draw straight

Re: [R] Subsetting vectors based on condition

2006-09-04 Thread jim holtman
vect.1 [1] 76 195 290 380 vect.2 [1] 63 95 133 170 215 253 285 299 325 375 unlist(lapply(vect.1, function(x)vect.2[which(vect.2 x)[1]])) [1] 95 215 299 NA On 9/3/06, Mahesh Krishnan [EMAIL PROTECTED] wrote: Hello, I have a question regarding subsetting of vectors. Here's an example

Re: [R] Fitting Pareto distribution to some data

2006-09-04 Thread Paul Smith
On 9/3/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: I am trying to fit Pareto distribution to some data. MASS package does not support Pareto distribution. Is there some alternative way? Actually fitdistr{MASS} does if you supply the pdf for a Pareto. That is not in base R, but easy to

Re: [R] Question on Chi-square of null model in sem package

2006-09-04 Thread John Fox
Dear Wei-Wei, As I explained to you in private email yesterday (perhaps you didn't receive my reply?), the problem that you point out is due to a bug in the sem function that I fixed some time ago and then inadvertently reintroduced. Yesterday, I sent a corrected version of the sem package

[R] library(plgem)

2006-09-04 Thread Amir Safari
Dear Users, library(plgem) doesn't exist directly in the list of available packages of R. Where could it be found? Thanks so much for help. Amir - [[alternative HTML version deleted]]

[R] how to fit gauss beam?

2006-09-04 Thread Thomas Hunger
Hello, I am having a hard time fitting a gauss beam using R. In gnutplot I did something like $ w(z) = w0 * sqrt(1+(z/z0)**2) $ fit w(z) 'before_eom.txt' using 1:2 via w0, z0 to obtain w0 and z0. Now I want to do the same in R. I tried a linear model like this (r = radius, z = distance):

Re: [R] library(plgem)

2006-09-04 Thread john seers \(IFR\)
Perhaps here? http://www.bioconductor.org/packages/bioc/1.6/src/contrib/html/plgem.htm l -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Amir Safari Sent: 04 September 2006 14:44 To: R-help@stat.math.ethz.ch Subject: [R] library(plgem)

Re: [R] newbie question about index

2006-09-04 Thread sun
Thanks for all these replies, all work perfectly. Sun --- Petr Pikal [EMAIL PROTECTED]写道: Hallo probably there are other options but outer(1:3,a, ==)*1 can do what you want. HTH Petr On 31 Aug 2006 at 22:41, z s wrote: Date sent:Thu, 31 Aug 2006 22:41:27 +0800

Re: [R] generating loglogistic distribution in R

2006-09-04 Thread Ben Bolker
nmi13 nmi13 at ext.canterbury.ac.nz writes: Hi Dear ??? Can someone please inform me on genreating random variables of Loglogistic, and PERT beta distributions? loglogistic: exp(n,rlogis(n,...)) I'm not sure about the PERT beta -- a few seconds of web browsing suggests that it's

[R] Questions about sort data

2006-09-04 Thread Xiao Zhao
Dear R users, I am doing my project which I want to plot a piecewise function, I knew that I can use the command segments to plot. But the problem is I want to use my real data which needs me to sort of my data by using the 'if else'command, I use it If(t[i]36) lambda-0.5 Else lambda-0.2 The

Re: [R] Questions about sort data

2006-09-04 Thread Gabor Grothendieck
Regarding your other questions On 9/4/06, Xiao Zhao [EMAIL PROTECTED] wrote: Dear R users, I am doing my project which I want to plot a piecewise function, I knew that I can use the command segments to plot. But the problem is I want to use my real data which needs me to sort of my data by

[R] Problems with 2-D Kernel Density Estimation using MASS KernSmooth

2006-09-04 Thread Chanchal Kumar
Dear R-Users, I am using the two dimensional Kernel density estimation function in MASS package (specifically kde2d) and am having a recurrent problem. The problem is that when my data vectors have less then 3 entries then the functions gives me the density estimate. But when the

Re: [R] Cross-correlation between two time series data

2006-09-04 Thread Spencer Graves
'ccf' provides a plot with red, dashed lines indicating an approximate 95% threshold for the correlation. Beyond that, with any particular model fit, you can get confidence intervals and anova tests for any particular parameter estimated. If neither of these are adequate, I

[R] opening files in directory

2006-09-04 Thread Ffenics
Hi there I want to be able to take all the files in a given directory, read them in one at a time, calculate a distance matrix for them (the files are data matrices) and then print them out to separate files. This is the code I thought I would be able to use (all files are in directory

Re: [R] opening files in directory

2006-09-04 Thread Uwe Ligges
FAQ ... Uwe Ligges Ffenics wrote: Hi there I want to be able to take all the files in a given directory, read them in one at a time, calculate a distance matrix for them (the files are data matrices) and then print them out to separate files. This is the code I thought I would be able

[R] read csv

2006-09-04 Thread Georg Otto
Hi, I have a csv file where the number of filled columns varies in the different rows: Sun 5-Feb-06,15,,,01:30:00,0:06:00, Mon 6-Feb-06,, Tue 7-Feb-06,7,,,00:41:00,0:05:51, Wed 8-Feb-06,, I would like to use read.table (or whatever is appropriate) to read in only those rows that have

Re: [R] opening files in directory

2006-09-04 Thread Ffenics
Yes, already looked at the FAQ. Thats how I have got where I am. I didnt see a solution to this particular problem on there though Thanks anyway. Uwe Ligges [EMAIL PROTECTED] wrote: FAQ ... Uwe Ligges Ffenics wrote: Hi there I want to be able to take all the files in a given directory,

Re: [R] read csv

2006-09-04 Thread Prof Brian Ripley
On Mon, 4 Sep 2006, Georg Otto wrote: Hi, I have a csv file where the number of filled columns varies in the different rows: Sun 5-Feb-06,15,,,01:30:00,0:06:00, Mon 6-Feb-06,, Tue 7-Feb-06,7,,,00:41:00,0:05:51, Wed 8-Feb-06,, I would like to use read.table (or whatever is

Re: [R] read csv

2006-09-04 Thread Thomas Hunger
I have a csv file where the number of filled columns varies in the different rows: I would hack it like this, but then I am totally new to R, which means you should not trust me.: d - read.csv(testdata, header=F) selection - apply(d, c(1), function(x) {sum(!is.na(x) x != ) 2})

Re: [R] Fitting Pareto distribution to some data

2006-09-04 Thread William Asquith
Paul, Package lmomco fits generalized pareto (three parameter) using method of L-moments. I suspect that other packages that Brian identified use method of moments or other. William On Sep 3, 2006, at 10:55 AM, Paul Smith wrote: Dear All I am trying to fit Pareto distribution to some

Re: [R] Subsetting vectors based on condition

2006-09-04 Thread J. Hosking
Mahesh Krishnan wrote: Hello, I have a question regarding subsetting of vectors. Here's an example of what I'm trying to do: vect.1 - c(76,195, 290, 380) vect.2 - c(63, 95, 133, 170, 215, 253, 285, 299, 325, 375) I would like to subset vect.2 so that it has the same length as

Re: [R] Fitting Pareto distribution to some data

2006-09-04 Thread Paul Smith
On 9/4/06, William Asquith [EMAIL PROTECTED] wrote: Package lmomco fits generalized pareto (three parameter) using method of L-moments. I suspect that other packages that Brian identified use method of moments or other. That is excellent to learn that, William. Thanks. Paul On Sep 3,

Re: [R] Optimization

2006-09-04 Thread Spencer Graves
Have you considered talking logarithms of the expression you mentioned: log(Yield) = a1*log(A)+b1*log(B)+c2*log(C)+... where a1 = a/(a+b+...), etc. This model has two constraints not present in ordinary least squares: First, the intercept is assumed to be zero. Second, the

Re: [R] opening files in directory

2006-09-04 Thread Mike Nielsen
R won't do variable interpolation inside quotation marks as perl does. You could try amending your code with, for e.g. file.name-paste(sep=/,data_files,files[[i]]) x-read.table(file.name) Regards, Mike On 9/4/06, Ffenics [EMAIL PROTECTED] wrote: Hi there I want to be able to take all the

Re: [R] opening files in directory

2006-09-04 Thread Gabor Grothendieck
On 9/4/06, Mike Nielsen [EMAIL PROTECTED] wrote: R won't do variable interpolation inside quotation marks as perl does. Just as an aside, gsubfn in package gsubfn will do perl-style (well, sort of) string interpolation: library(gsubfn) i - 1 gsubfn(x = data_files/file$i) [1] data_files/file1

Re: [R] abline and plot(augPred) help

2006-09-04 Thread Paul Murrell
Hi Petr Pikal wrote: Dear all as I did not get any response on my post about abline and plot(augPred)) I try again. I hope I do not break some posting guide rules. I would try to contact package maintainer directly but there is stated to be R-core people, so I feel R-help list shall be

Re: [R] abline and plot(augPred) help

2006-09-04 Thread Gabor Grothendieck
On 9/4/06, Paul Murrell [EMAIL PROTECTED] wrote: Hi Petr Pikal wrote: Dear all as I did not get any response on my post about abline and plot(augPred)) I try again. I hope I do not break some posting guide rules. I would try to contact package maintainer directly but there is

[R] Coercing elements of a matrix from integer to double

2006-09-04 Thread Thaden, John J
Ive been converting elements of matrices and arrays, e.g., from Integers to double-precision, by vectorizing the matrix and then remaking it. Alternatively, I can redefine one element as double which then redefines them all. Both methods are quick, so I guess I shouldn't complain, but I would

Re: [R] Coercing elements of a matrix from integer to double

2006-09-04 Thread Peter Dalgaard
Thaden, John J [EMAIL PROTECTED] writes: Ive been converting elements of matrices and arrays, e.g., from Integers to double-precision, by vectorizing the matrix and then remaking it. Alternatively, I can redefine one element as double which then redefines them all. Both methods are quick,

Re: [R] how to fit gauss beam?

2006-09-04 Thread Thomas Hunger
Reply to self: I am having a hard time fitting a gauss beam using R. In gnutplot I did something like $ w(z) = w0 * sqrt(1+(z/z0)**2) $ fit w(z) 'before_eom.txt' using 1:2 via w0, z0 to obtain w0 and z0. Now I want to do the same in R. I tried a linear model like this (r = radius, z =

Re: [R] Cross-correlation between two time series data

2006-09-04 Thread Andrew Robinson
Jun, If your interest is to estimate the correlation and either a confidence interval or a test for no correlation, then you might try to proceed as follows. This is a Monte-Carlo significance test, and a useful strategy. 1) use ccf() to compute the cross-correlation between x and y. 2) repeat

Re: [R] Subsetting vectors based on condition

2006-09-04 Thread Mahesh Krishnan
Sincere thanks to Jim Holtman and J. Hosking for their suggestions. both their solutions work perfectly, in particular the findInterval function is what I was looking for. Cheers. Mahesh Krishnan __ R-help@stat.math.ethz.ch mailing list

[R] Fitting generalized additive models with constraints?

2006-09-04 Thread David Reiss
Hello, I am trying to fit a GAM for a simple model, a simple model, y ~ s(x0) + s(x1) ; with a constraint that the fitted smooth functions s(x0) and s(x1) have to each always be 0. From the library documentation and a search of the R-site and R-help archives I have not been able to decipher

[R] Problem with Variance Components (and general glmm confusion)

2006-09-04 Thread Toby Gardner
Dear list, I am having some problems with extracting Variance Components from a random-effects model: I am running a simple random-effects model using lme: model-lme(y~1,random=~1|groupA/groupB) which returns the output for the StdDev of the Random effects, and model AIC etc as expected.

Re: [R] Cross-correlation between two time series data

2006-09-04 Thread Spencer Graves
Hi, Andrew: This will produce a permutation distribution for the correlation under the null hypothesis of zero correlation between the variables. This is a reasonable thing to do, and would probably produce limits more accurate than the dashed red lines on the 'ccf' plot. However,

[R] plot a new picture against an old one to see the difference between them

2006-09-04 Thread Am Stat
Hello, useR:, Suppose I have two plots made by using contour() function, say Cont1 and Cont2 respectively. They have slightly difference because of the two slightly different data I used. I want to see the difference between them so I want to plot Cont2 on Cont1, are there any methods to

Re: [R] plot a new picture against an old one to see the difference between them

2006-09-04 Thread Am Stat
Dear Roger, Thanks, that's really helpful, do you know how to deal with it if the two plots are generated by plot(), not by contour(). Best, Leon - Original Message - From: roger koenker [EMAIL PROTECTED] To: Am Stat [EMAIL PROTECTED] Sent: Monday, September 04, 2006 8:06 PM

[R] Help with plotmath

2006-09-04 Thread Kenneth Cabrera
Hi R users: How can I have several subscript number with a comma in a plot. I would like to have the LaTeX equivalent of x_{i,j}. I try: plot(1:10,1:10,type=n) text(5,5,expression(x[i,j])) but it doesn´t work. Thank you for your help. __

[R] Sweave and the [ function

2006-09-04 Thread Ross Darnell
I am wanting to use the [ operator in an S-chunk, e.g. = str(women) women$height women[,1] [(women,1) @ to show the equivalence of three methods of extracting an element from a data.frame. However Sweave returns the last of these as women[1] in the S input chunk How can I force it not to

Re: [R] Question on Chi-square of null model in sem package

2006-09-04 Thread Guo Wei-Wei
Dear Pref. Fox Sorry, I didn't receive your reply. I try the new sem package. It's great. The following is the results that I got. The fit indices are fine. Model Chisquare = 208 Df = 98 Pr(Chisq) = 6.6e-10 Chisquare (null model) = 1741 Df = 120 Goodness-of-fit index = 0.9 Adjusted

Re: [R] Cross-correlation between two time series data

2006-09-04 Thread Andrew Robinson
Hi Spencer, you are quite right. I should have been careful to emphasize that the strategy I suggested was intended only to produce the test for no correlation clause of the either a confidence interval or a test for no correlation sentence. Cheers Andrew On Mon, Sep 04, 2006 at 04:00:44PM

Re: [R] Help with plotmath

2006-09-04 Thread Gabor Grothendieck
Try: text(5,5,expression(x[i * , * j])) On 9/4/06, Kenneth Cabrera [EMAIL PROTECTED] wrote: Hi R users: How can I have several subscript number with a comma in a plot. I would like to have the LaTeX equivalent of x_{i,j}. I try: plot(1:10,1:10,type=n) text(5,5,expression(x[i,j]))

Re: [R] Sweave and the [ function

2006-09-04 Thread hadley wickham
= str(women) women$height women[,1] [(women,1) @ to show the equivalence of three methods of extracting an element from a data.frame. However Sweave returns the last of these as women[1] in the S input chunk How can I force it not to do this and return [(women,1) I don't think

Re: [R] Sweave and the [ function

2006-09-04 Thread Vincent Goulet
Le Mardi 5 Septembre 2006 0:03, hadley wickham a écrit : = str(women) women$height women[,1] [(women,1) @ to show the equivalence of three methods of extracting an element from a data.frame. However Sweave returns the last of these as women[1] in the S input chunk

[R] colorRamp

2006-09-04 Thread Rick Bischoff
Hi, I am using colorRamp in the following way. I am *sure* there is a better way to do this, so if you'd be so kind to show me the true R way: Step 0: Create a new variable, say, x, that maps some other continuous variable I have onto the [0,1] line. Step 1: Store the result from colorRamp

[R] Quick question about lm()

2006-09-04 Thread Tong Wang
Hi, Feel awkward to ask , but really couldn't find a answer anywhere, How could I extract the R^2 and t-stat. from the result of lm()? Thanks a lot. best __ R-help@stat.math.ethz.ch mailing list

Re: [R] Quick question about lm()

2006-09-04 Thread Christos Hatzis
Say, my.lm - lm(y ~ x, data=my.data) Then if you try: names(summary(my.lm)) you will see the components of the summary.lm object. The coefficients and t-statistics can be extracted by summary(my.lm)$coefficients and similarly for the r-squared and other statistics provided in the summary