Re: [R] PCA functions

2009-02-16 Thread Bjørn-Helge Mevik
glenn g1enn.robe...@btinternet.com writes: Is there a function (before I try and write it !) that allows the input of a covariance or correlation matrix to calculate PCA, rather than the actual data as in princomp() Yes, there is: princomp(). :-) -- Bjørn-Helge Mevik

Re: [R] I want axes that cross

2009-02-16 Thread Mark Difford
Hi Paul, Have you ever seen a drawing of the regions of an R plot with the terminology that is used for parts? From what I can remember, several documents on CRAN cover this. The one that springs to mind is Alzola Harrell's An Introduction to S and the Hmisc and Design Libraries,” which you

Re: [R] Unadulterated plot

2009-02-16 Thread Simon Pickett
Hi James, What you really need to do is to check out the many freely available pdfs for R beginners. Here is a good place to start http://cran.r-project.org/other-docs.html If I am right interpreting what you want, I think you need to create a blank plot with no axes, axis labels etc. Try

Re: [R] PCA functions

2009-02-16 Thread andrew
The PCA is just a singular value decomposition on a sample covariance/ correlation matrix. Do a search for ?svd and get the eigenvalues and vectors from that function. On Feb 14, 10:30 am, glenn g1enn.robe...@btinternet.com wrote: Hi All, would appreciate an answer on this if you have a moment;

[R] How to create sequence of constant time interval

2009-02-16 Thread Suresh_FSFM
Dear R-Experts, seek your help. There are two parts I want to deal with. 1) I want to create a time interval of say, 30 minutes starting from 00:00:00 hrs Thus at the end, I want to create sequence: 00:00:00 00:30:00 01:00:00 01:30:00 .. .. How to do so ? Later, I want to change the

[R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the unrestricted solution matches the example I am following, and I can

Re: [R] PCA functions

2009-02-16 Thread Mark Difford
Hi Glen, Andrew, The PCA is just a singular value decomposition on a sample covariance/... I believe that Bjørn-Helge Mevik's point was that __if you read the documentation__ you will see the argument covmat to princomp(). This, really, is much more straightforward and practical than Andrew's

[R] solve.QP with box and equality constraints

2009-02-16 Thread Selwyn McCracken
[reposting as a plain text - apologies for the double posting] Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the

[R] Comparison of age categories using contrasts

2009-02-16 Thread Patrick Giraudoux
Dear listers, I would like to compare the levels of a factor with 8 age categories (0,10] (10,20] (20,30] (30,40] (40,50] (50,60] (60,70] (70,90] (however, the factor has not been ordered yet). The default in glm is cont.treatment (for unordered factors) and that leads to compare each level to

[R] problem with gls finding model terms without specifying data=named.object

2009-02-16 Thread Paul.Rustomji
Hello R-help I am having trouble getting gls to find the R objects that comprise a linear model when the data=named.object option(option!) is not specified. In the gls() help it states data is an optional data frame containing the variables named in model, correlation, weights, and subset. By

Re: [R] PCA functions

2009-02-16 Thread S Ellison
princomp uses the raw data and calculates the correlation or covariance matrix on the way to the PC's, so that doesn't use a correlation matrix itself. You do, however, get the choice. However, PC's are the eigenvectors of the correlation (or covariance) matrix, so in principle calling eigen()

[R] Personal invitation from srinivasa raghavan

2009-02-16 Thread srinivasa raghavan
Hi, On 2/2/2009 3:10:07 AM, you were invited to join srinivasa raghavan's UNYK address book so he/she would always have access to your contact info and you to his/hers. To accept his/her request, Click here.

Re: [R] PCA functions

2009-02-16 Thread andrew
sqrt(svd(x)$d) maybe 2 more operations than princomp(covmat=x), but it is hardly a chore. On Feb 16, 9:15 pm, Mark Difford mark_diff...@yahoo.co.uk wrote: Hi Glen, Andrew, The PCA is just a singular value decomposition on a sample covariance/... I believe that Bjørn-Helge Mevik's point was

Re: [R] PCA functions

2009-02-16 Thread Gavin Simpson
On Mon, 2009-02-16 at 10:45 +, S Ellison wrote: princomp uses the raw data and calculates the correlation or covariance matrix on the way to the PC's, so that doesn't use a correlation matrix itself. You do, however, get the choice. That *isn't* what princomp() does. If you supply a valid

Re: [R] How to create sequence of constant time interval

2009-02-16 Thread Gabor Grothendieck
Try this (and see R News 4/1 for more). library(chron) tt - times(0:47/48) tt [1] 00:00:00 00:30:00 01:00:00 01:30:00 02:00:00 02:30:00 03:00:00 03:30:00 04:00:00 04:30:00 05:00:00 05:30:00 06:00:00 06:30:00 07:00:00 07:30:00 [17] 08:00:00 08:30:00 09:00:00 09:30:00 10:00:00 10:30:00 11:00:00

Re: [R] How to create sequence of constant time interval

2009-02-16 Thread Suresh_FSFM
Thank you very much for the precise response. Regards, Suresh Suresh_FSFM wrote: Dear R-Experts, seek your help. There are two parts I want to deal with. 1) I want to create a time interval of say, 30 minutes starting from 00:00:00 hrs Thus at the end, I want to create

[R] Don't find a package !

2009-02-16 Thread nabler
Hi, Please could somebody has any information about the following package: IlluminaGUI, published here: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btm101v1 The link given in the article is dead and authors doesn't reply ! Is there someone who uses it ? Thank you very much

[R] Dynamic Panel Analysis in R

2009-02-16 Thread Millo Giovanni
Dear Tanveer and Johannes, it *is* indeed possible to estimate dynamic panels by GMM with plm. As Johannes observes, ?pgmm is a good start. Please see also the package vignette or its close cousin, this paper on JSS http://www.jstatsoft.org/v27/i02, section 5.4. Johannes, if you had problems

Re: [R] Don't find a package !

2009-02-16 Thread Wolfgang Raffelsberger
You're looking in the wrong repository ! It's on www.bioconductor.org Wolfgang nabler a écrit : Hi, Please could somebody has any information about the following package: IlluminaGUI, published here: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btm101v1 The link given in

[R] Alternate to for-loop

2009-02-16 Thread megh
Hi, I am trying to create a vector of length 10 (say), wherein each element will be average of random sample of size 100, from a distribution, say Normal. Can anyone please tell me without creating a for loop, how I can do that? Regards, -- View this message in context:

Re: [R] Alternate to for-loop

2009-02-16 Thread Henrique Dallazuanna
Try this: replicate(10, mean(rnorm(100))) On Mon, Feb 16, 2009 at 8:59 AM, megh megh700...@yahoo.com wrote: Hi, I am trying to create a vector of length 10 (say), wherein each element will be average of random sample of size 100, from a distribution, say Normal. Can anyone please tell me

Re: [R] (no subject)

2009-02-16 Thread Vincze Orsolya
There are three columns, I was just careless. I succeed to merge the two tables. But: 1) in the first table there were rows, which were not present in the second table, these rows were deleted from the merged table too, but I need them. 2) If i want to import from the second table just a certain

[R] Ideal (possible) configuration for an exalted R system

2009-02-16 Thread Harsh
Hi All, I am trying to assemble a system that will allow me to work with large datasets (45-50 million rows, 300-400 columns) possibly amounting to 10GB + in size. I am aware that R 64 bit implementations on Linux boxes are suitable for such an exercise but I am looking for configurations that R

Re: [R] Alternate to for-loop

2009-02-16 Thread Uwe Ligges
megh wrote: Hi, I am trying to create a vector of length 10 (say), wherein each element will be average of random sample of size 100, from a distribution, say Normal. Can anyone please tell me without creating a for loop, how I can do that? Homework? Then please ask you course material or

Re: [R] (no subject)

2009-02-16 Thread Uwe Ligges
Vincze Orsolya wrote: There are three columns, I was just careless. I succeed to merge the two tables. But: 1) in the first table there were rows, which were not present in the second table, these rows were deleted from the merged table too, but I need them. 2) If i want to import from the

Re: [R] PCA functions

2009-02-16 Thread S Ellison
Many apologies for the poor steer; you are quite right. 'fraid I hit 'send' before double-checking the help page myself. Next time... S Gavin Simpson gavin.simp...@ucl.ac.uk 16/02/2009 10:59 On Mon, 2009-02-16 at 10:45 +, S Ellison wrote: princomp uses the raw data and calculates the

Re: [R] Transformation of Variables

2009-02-16 Thread David Winsemius
There are a series of coercion functions, all beginning with as. which are designed to return (when possible) objects of specified types. Since you offer three examples, only one of which I recognize as a valid R type, I am wondering what R text you have been using? -- David Winsemius On

Re: [R] Transformation of Variables

2009-02-16 Thread jim holtman
It would be useful to have some sample input data and then what you expect as output. You can always convert the characters to factors and then use the integer values assigned. On Mon, Feb 16, 2009 at 2:00 AM, Arup arup.pramani...@gmail.com wrote: I have a data frame in R where all the

Re: [R] Time series

2009-02-16 Thread stephen sefick
?zoo On Mon, Feb 16, 2009 at 1:16 AM, miya ontiveros_pal...@yahoo.com wrote: Hello everyone. I am trying to plot data from a time series in R and have run across some problems. I was wondering if someone could help. I have data taken every 15 minutes of a list of rankings of 25 titles. I

Re: [R] Alternate to for-loop

2009-02-16 Thread megh
No, it is not homework. I obviously could do that using a for-loop, and that I already did. However I thought whether there could be a better approach as it was looking very messy and unprofessional. Uwe Ligges-3 wrote: megh wrote: Hi, I am trying to create a vector of length 10 (say),

Re: [R] I want axes that cross

2009-02-16 Thread Marc Schwartz
I would also add: 1. Chapter 12 in An Introduction to R 2. Chapter 3 in Paul's R Graphics book: http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html Note that the figures and code used for the graphics in the above chapter are available here:

[R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Eleni Rapsomaniki
Given a cox model: library(Hmisc); library(survival); (library(Design); cox.model=cph(Surv(futime, fustat) ~ age, data=ovarian, surv=T) str(cox.model) What I need is the total estimated time until failure (death), not the probability of failing at a given time (survival

[R] Odp: several ifelse problems...

2009-02-16 Thread Petr PIKAL
Hi x - seq(0,1,.01) y - ifelse(abs(x-.5)=0.3,0, + ifelse(abs(w-.5)=0.4,-1, +ifelse((0.1w w0.2),10*x-2,-10*x+8))) Error in storage.mode(test) - logical : object w not found what is w? Why did you use ? and indicate logical AND and | and || indicate logical

Re: [R] loading mgcv package

2009-02-16 Thread Simon Wood
What happens if you type runif(1) before loading `mgcv'? best, Simon On Sunday 15 February 2009 17:06, Veerappa Chetty wrote: Hi ,When I try to load the 'mgcv package, often, but not always, get this error message. What am I doing wrong? I even tried reinstalling a few times.

[R] is there any way to find match with tolerance

2009-02-16 Thread Suresh_FSFM
Hello all, suppose I have a time-stamp: 16-02-2009 00:20:00 and other array that stores lot of time values. My tolerance limit = +5 minutes I would like to find values from this array matching with the value: 16-02-2009 00:20:00 + tolerance Before I write some function, I would like to know:

[R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Eleni Rapsomaniki
Given a cox model:   library(Hmisc); library(survival); (library(Design); cox.model=cph(Surv(futime,  fustat) ~ age, data=ovarian, surv=T) str(cox.model)   What I need is the total estimated time until failure (death), not the probability of failing at a given time (survival probability), or

Re: [R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Frank E Harrell Jr
Eleni Rapsomaniki wrote: Given a cox model: library(Hmisc); library(survival); (library(Design); cox.model=cph(Surv(futime, fustat) ~ age, data=ovarian, surv=T) str(cox.model) What I need is the total estimated time until failure (death), not the probability of failing at a given time

Re: [R] Alternate to for-loop

2009-02-16 Thread Uwe Ligges
megh wrote: No, it is not homework. I obviously For some value of obvious as you has not given a single line of code as the posting guide suggests. You probably want: replicate(10, mean(rnorm(100))) Uwe Ligges could do that using a for-loop, and that I already did. However I thought

Re: [R] How to create sequence of constant time interval

2009-02-16 Thread Tony Breyal
ahh, didn't see Gabor's solution, that works much better :-) On 16 Feb, 10:00, Suresh_FSFM suresh.ghals...@gmail.com wrote: Dear R-Experts, seek your help. There are two parts I want to deal with. 1) I want to create a time interval of say, 30 minutes starting from 00:00:00 hrs Thus at

Re: [R] solve.QP with box and equality constraints

2009-02-16 Thread Berwin A Turlach
G'day Selwyn, On Mon, 16 Feb 2009 10:11:20 + Selwyn McCracken selwyn.mccrac...@gmail.com wrote: I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using

[R] How to add direction of time to plot.circular()

2009-02-16 Thread Michael Kubovy
Dear r-helpers, I want to show that time is flowing CCW in the following: require(circular) len - 8 labl - as.character(c(0, 1, 1, 1, 0, 0, 1, 0)) r - circular(2*pi* (rep(c(1, 3, 6), each = 200)/len + rnorm(600, 0, 0.025))) r.dens - density(r, bw = 25, adjust = 4, kernel = 'vonmises') plot(r,

Re: [R] is there any way to find match with tolerance

2009-02-16 Thread Gabor Grothendieck
?all.equal has a tolerance argument. On Mon, Feb 16, 2009 at 8:41 AM, Suresh_FSFM suresh.ghals...@gmail.com wrote: Hello all, suppose I have a time-stamp: 16-02-2009 00:20:00 and other array that stores lot of time values. My tolerance limit = +5 minutes I would like to find values from

[R] odd GARCH(1,1) results

2009-02-16 Thread Helena Richter
Hi everybody, I'm trying to fit a Garch(1,1) process to the DAX returns. My data consists of about 2300 10day-logreturns in chronologically descending order (see attachment). But if I use the garch function I get a very high alpha_1 and a quite low beta, which doesn't make that much sense. I

[R] I can't apply the summary function when I use de armaFit (fArma)...

2009-02-16 Thread Ana Patricia Silva Cunha Martins (DGR)
Hi, I can't apply the summary function when I use de armaFit (fArma). Can you help? fit-armaFit(~arma(1,0),data=age55) fit Title: ARIMA Modelling Call: armaFit(formula = ~arma(1, 0), data = age55) Model: ARIMA(1,0,0) with method: CSS-ML Coefficient(s): ar1 intercept

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Gabor Grothendieck
Or safer: df - as.integer(round(...)) On Mon, Feb 16, 2009 at 10:54 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Try this: On Mon, Feb 16, 2009 at 9:02 AM, Michael Friendly frien...@yorku.ca wrote: For glm() models, I often find both the print() and summary() method disappointing

Re: [R] (no subject)

2009-02-16 Thread Peter Dalgaard
Uwe Ligges wrote: Vincze Orsolya wrote: There are three columns, I was just careless. I succeed to merge the two tables. But: 1) in the first table there were rows, which were not present in the second table, these rows were deleted from the merged table too, but I need them. 2) If i

Re: [R] LCA (e1071 package): error

2009-02-16 Thread Evgenia
Before using lca, try data-as.matrix(data). For example when I tried using lca lca(LSAT,2,niter=100) for known LSAT data (library ltm), I took error messages. But, when I use data-as.matrix(LSAT) lca(data,2,niter=100) I took results for lca King Regards, Evgenia Tryntsje Wesselius wrote:

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Dieter Menne
Gabor Grothendieck ggrothendieck at gmail.com writes: Or safer: df - as.integer(round(...)) Did you try? I believe it is a problem of printCoefmat that has quite a few options for special column, but none for df. Ask Martin Mächler. Dieter __

Re: [R] is there any way to find match with tolerance

2009-02-16 Thread Suresh_FSFM
Thank you for the positve response. Gabor Grothendieck wrote: ?all.equal has a tolerance argument. On Mon, Feb 16, 2009 at 8:41 AM, Suresh_FSFM suresh.ghals...@gmail.com wrote: Hello all, suppose I have a time-stamp: 16-02-2009 00:20:00 and other array that stores lot of time

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Gabor Grothendieck
On Mon, Feb 16, 2009 at 11:08 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: Gabor Grothendieck ggrothendieck at gmail.com writes: Or safer: df - as.integer(round(...)) Did you try? I believe it is a problem of printCoefmat that has quite a few options for special column, but none

[R] scatterplot and correlation for weird data format

2009-02-16 Thread William Simpson
I have data in a format like this: namessexsex viewnum rating rt ahl4f m f 56 -1082246 ahl4f m f 74 85 1444 ahl4f m f 52 151 1595 ahl4f m f 85 1 1447

[R] Using eval in multinom argument

2009-02-16 Thread Crouch, Daniel
Hi, I am having difficulty entering a 'programmable' argument into the multinom function from the nnet package. Interactively, I can get the function to work fine by calling it this way: z1=multinom(formula = class.ind(grp[-outgroup])~ (PC1 + PC2 + PC3), data=data.frame(scores)) However I

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Dieter Menne
Gabor Grothendieck ggrothendieck at gmail.com writes: On Mon, Feb 16, 2009 at 11:08 AM, Dieter Menne Yes, with as.integer(round(...)) It looks like this: modelFit.glm(berk.mod2) Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 modelFit.glm(berk.mod2) Analysis of

Re: [R] (no subject)

2009-02-16 Thread Uwe Ligges
Peter Dalgaard wrote: Uwe Ligges wrote: Vincze Orsolya wrote: There are three columns, I was just careless. I succeed to merge the two tables. But: 1) in the first table there were rows, which were not present in the second table, these rows were deleted from the merged table too, but I

Re: [R] Alternate to for-loop

2009-02-16 Thread Patrick Burns
If the goal is to look professional, then 'replicate' probably suits. If the goal is to compute as fast as possible, then that isn't the case because 'replicate' is really a 'for' loop in disguise and there are other ways. Here's one other way: function (size, replicates, distfun, ...) {

Re: [R] Alternate to for-loop

2009-02-16 Thread Gustaf Rydevik
On Mon, Feb 16, 2009 at 12:59 PM, megh megh700...@yahoo.com wrote: Hi, I am trying to create a vector of length 10 (say), wherein each element will be average of random sample of size 100, from a distribution, say Normal. Can anyone please tell me without creating a for loop, how I can do

Re: [R] scatterplot and correlation for weird data format

2009-02-16 Thread hadley wickham
On Mon, Feb 16, 2009 at 10:21 AM, William Simpson william.a.simp...@gmail.com wrote: I have data in a format like this: namessexsex viewnum rating rt ahl4f m f 56 -1082246 ahl4f m f 74 85 1444 ahl4f

[R] Printing out a graph using different graphics devices

2009-02-16 Thread Dimitri Liakhovitski
Hello, everyone! The code below allows me to produce the graph I want (I know - the colors are strange, but it's just for the sake of an example). After you run the plot- part and then do print(plot) - that's what I want. However, when I run the bits of code below (with graphics devices) - what

[R] Whitening Time Series

2009-02-16 Thread Pele
Hi R users, I am doing cross correlation analysis on 2 time series (call them y-series and x-series) where I need the use the model developed on the x-series to prewhiten the yseries.. Can someone point me to a function/filter in R that would allow me to do that? Thanks in advance for any

[R] assuming AR(1) residuals in OLS

2009-02-16 Thread constantine
Hi to all, In other statistical software, such as Eviews, it is possible to regress a model with the Least Squares method, assuming that the residuals follow an AR(q) process. For example the resulting regression is something like y = 1.2154 + 0.2215 x + 0.251 AR(1) How is it possible to do

[R] sandwich matrix multiplication and efficient determinant

2009-02-16 Thread Shimrit Abraham
Hi, I am looking for two ways to speed up my computations: 1. Is there a function that efficiently computes the 'sandwich product' of three matrices, say, ZPZ' 2. Is there a function that efficiently computes the determinant of a positive definite symmetric matrix? Thanks, S.A.

Re: [R] Outlier Detection for timeseries

2009-02-16 Thread Bert Gunter
Danger: More careful thought required. Outliers (Title of a TECHNOMETRICS paper of a couple of decades ago) are an artificial construct: there is NO SUCH THING in the abstract. They exist only wrt to a model. So there is no such thing as software that tells whether the changes are considered

[R] Applying functions to partitions

2009-02-16 Thread Titus von der Malsburg
Hi list! I have a large matrix which I'd like to partition into blocks and for each block I'd like to compute the mean. Following a example where each letter marks a block of the partition: a a a d g g a a a d g g a a a d g g b b b e h h b b b e h h c c c f i i

Re: [R] (no subject)

2009-02-16 Thread Vincze Orsolya
Dear Peter,Thanks for the answer, it's working very well. And again sorry, about asking as a banal question, but I really didn't have who to ask to help me. Uwe: I don't have a teacher, I never learned R before. I'm just trying to learn self-educating, because it's very helpful in data

Re: [R] Using eval in multinom argument

2009-02-16 Thread Charles C. Berry
Forget eval(parse(text = )) See ?as.formula ?update.formula and try out the example() s there. HTH, Chuck On Mon, 16 Feb 2009, Crouch, Daniel wrote: Hi, I am having difficulty entering a 'programmable' argument into the multinom function from the nnet package.

Re: [R] Whitening Time Series

2009-02-16 Thread stephen sefick
if you want to whiten the series why not just new series - rnorm(num.obs)+series On Mon, Feb 16, 2009 at 12:25 PM, Pele drdi...@yahoo.com wrote: Hi R users, I am doing cross correlation analysis on 2 time series (call them y-series and x-series) where I need the use the model developed on

Re: [R] assuming AR(1) residuals in OLS

2009-02-16 Thread Michael Kubovy
?gls On Feb 16, 2009, at 12:28 PM, constantine wrote: In other statistical software, such as Eviews, it is possible to regress a model with the Least Squares method, assuming that the residuals follow an AR(q) process. For example the resulting regression is something like y = 1.2154 +

[R] Help with rgl

2009-02-16 Thread Iuri Gavronski
Hi, I don't know much about the RGL package, and I have read the documentation and tried some parameters, with no luck... I would like to generate a movie from a 3D object (code below), where the vortex A is closer to the observer, and then the object rotates and the B vortex gets closer. I would

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-16 Thread Greg Snow
I had a Murphy's law calendar a while back with many different laws in it. One of those laws was along the lines of: An easily understood, simple falsehood is often more useful than a complicated, often misunderstood truth (though the original was probably much better phrased than my memory).

Re: [R] several ifelse problems...

2009-02-16 Thread Patrizio Frederic
do you mean: f=function(x) 0*(abs(x-.5)=.3)-1*(abs(x-.5)=.4)+(10*x-2)*(x.1x.2)+(-10*x+8)*(x=.2x=.5) f(x) curve(f,0,1) hope it helps. Patrizio 2009/2/14 kathie kathryn.lord2...@gmail.com: Dear R users, From the code below, I try to compute y value. (In fact, y looks like a trapezoid)

[R] Adjusting the Axis in a histogram to the prespecified breaks

2009-02-16 Thread Christian Langkamp
Hello I tried a few searches on hist, histogram, equidist and space (space=0 was mentioned in one contribution), but none of that so far worked. It also says in the help ##-- For non-equidistant breaks, counts should NOT be graphed unscaled: - which is precisely what I am looking for, but I

Re: [R] Applying functions to partitions

2009-02-16 Thread Titus von der Malsburg
On Mon, Feb 16, 2009 at 01:45:52PM -0500, Stavros Macrakis wrote: How are the blocks defined? As a priori index ranges? By factors? By some property of i,j? Or...? Ok, I should have been more specific. The blocks are defined by factors. There's a factor for the columns and a factor for the

Re: [R] Adjusting the Axis in a histogram to the prespecified breaks

2009-02-16 Thread Titus von der Malsburg
On Mon, Feb 16, 2009 at 11:08:24AM -0800, Christian Langkamp wrote: I could of course log the whole data set, but then explaining that transformation within a presentation is generally not a pleasant exercise. You don't have to explain it. Just calculate the hist of the log and label the axis

Re: [R] assuming AR(1) residuals in OLS

2009-02-16 Thread Prof Brian Ripley
You will need library(nlme) first. But not for ?arima, which seems the more obvious way to do this simple example. On Mon, 16 Feb 2009, Michael Kubovy wrote: ?gls On Feb 16, 2009, at 12:28 PM, constantine wrote: In other statistical software, such as Eviews, it is possible to regress a

Re: [R] Alternate to for-loop

2009-02-16 Thread Wacek Kusnierczyk
Patrick Burns wrote: If the goal is to look professional, then 'replicate' probably suits. If the goal is to compute as fast as possible, then that isn't the case because 'replicate' is really a 'for' loop in disguise and there are other ways. Here's one other way: function (size,

Re: [R] Applying functions to partitions

2009-02-16 Thread Charles C. Berry
On Mon, 16 Feb 2009, Titus von der Malsburg wrote: On Mon, Feb 16, 2009 at 01:45:52PM -0500, Stavros Macrakis wrote: How are the blocks defined? As a priori index ranges? By factors? By some property of i,j? Or...? Ok, I should have been more specific. The blocks are defined by factors.

Re: [R] superscript

2009-02-16 Thread David Douterlungne
David and Danel, Indeed, the missing symbol is *. Now it works, although, with a change of font in the brackets of the axis=label. Thanks, david To: daviddou...@hotmail.com Subject: Re: [R] superscript From: davidcr...@charter.net Date: Sat, 14 Feb 2009 17:49:11 -0600 Could it

[R] rimage

2009-02-16 Thread Koen Hufkens
Hi list, I'm trying to install/compile rimage on ubuntu linux (i386) interpid. However, the compilation hangs on: gcc -std=gnu99 -I/usr/share/R/include -g -O2 -fpic -g -O2 -c laplacian.c -o laplacian.o laplacian.c: In function ‘laplacian’: laplacian.c:14: warning: implicit declaration of

Re: [R] Applying functions to partitions

2009-02-16 Thread Stavros Macrakis
Assuming your matrix is: mm - matrix(runif(6*6),6,6) And your blocks are defined by integers or factors: cfact - c(1,1,1,2,3,3) rfact - c(1,1,1,2,2,3) Then the following should do the trick: matrix(tapply(mm, outer(rfact,cfact,paste), mean), length(unique(rfact)))

Re: [R] Applying functions to partitions

2009-02-16 Thread David Winsemius
Its not clear that the object returned from such an operation would be a matrix, but if things remain very regular then perhapos you will succeed with this: markmtx - matrix(scan(textConnection(a a a d g g + a a a d g g + a a a d g g + b b b e h h + b b b e h h + c c c f

Re: [R] Ideal (possible) configuration for an exalted R system

2009-02-16 Thread Kingsford Jones
Hi Harsh, The useR! 2008 site has useful information. E.g. talks by Graham Williams: http://www.statistik.uni-dortmund.de/useR-2008/slides/Williams.pdf Dirk Eddelbuettel http://www.statistik.uni-dortmund.de/useR-2008/tutorials/useR2008introhighperfR.pdf and others

Re: [R] Alternate to for-loop

2009-02-16 Thread Patrick Burns
Wacek Kusnierczyk wrote: Patrick Burns wrote: If the goal is to look professional, then 'replicate' probably suits. If the goal is to compute as fast as possible, then that isn't the case because 'replicate' is really a 'for' loop in disguise and there are other ways. Here's one other way:

Re: [R] rimage

2009-02-16 Thread Dirk Eddelbuettel
On 16 February 2009 at 21:09, Koen Hufkens wrote: | Hi list, | | I'm trying to install/compile rimage on ubuntu linux (i386) interpid. | However, the compilation hangs on: | | gcc -std=gnu99 -I/usr/share/R/include -g -O2 -fpic -g -O2 -c | laplacian.c -o laplacian.o | laplacian.c: In

Re: [R] Printing out a graph using different graphics devices

2009-02-16 Thread Greg Snow
You might want to look at the dev.copy function. I just tried with your example and the postscript device, used the print(plot) command with the postscript device open, then switched to the windows graphics device and did dev.copy then closed the postscript file, the result had 2 pages, the

[R] problem of local ! :-(

2009-02-16 Thread Suresh_FSFM
Dear R- Experts, Seek your help. I created a time sequence using: x[i] -chron(dates, tt, format=c(dates=y-m-d, tt=h:m:s)) first element in the list is displayed as: (09-01-01 00:00:00) Now, I want to store this value as date. If I use: format.Date(x[1],%y-%m-%d %H:%M:%S), I expect following

Re: [R] Comparison of age categories using contrasts

2009-02-16 Thread Greg Snow
One approach is to create your own contrasts matrix: mycmat - diag(8) mycmat[ row(mycmat) == col(mycmat) + 1 ] - -1 mycmati - solve(mycmat) contrasts(agefactor) - mycmati[,-1] Now when you use agefactor, the intercept will be the first age group and the slopes will be the differences

Re: [R] Applying functions to partitions

2009-02-16 Thread Martin Morgan
Stavros Macrakis macra...@alum.mit.edu writes: Assuming your matrix is: mm - matrix(runif(6*6),6,6) And your blocks are defined by integers or factors: cfact - c(1,1,1,2,3,3) rfact - c(1,1,1,2,2,3) Then the following should do the trick: matrix(tapply(mm,

Re: [R] rimage

2009-02-16 Thread Hufkens Koen
I would love to fix it however my C++ skills are limited. Hope someone fixes this before it disappears. Koen -Original Message- From: Dirk Eddelbuettel [mailto:e...@debian.org] Sent: Mon 16-2-2009 21:49 To: Hufkens Koen Cc: r-help@r-project.org Subject: Re: [R] rimage On 16 February

[R] incl.non.slopes=FALSE does not work at predict.lm

2009-02-16 Thread dimitris kapetanakis
Dear all, I am trying to estimate the prediction from a fixed effects model and their confidence intervals as well. Though I do not want to include in the prediction and at the confidence intervals the intercept. For that reason I used the argument incl.non.slopes=FALSE. But either if it is TRUE

Re: [R] incl.non.slopes=FALSE does not work at predict.lm

2009-02-16 Thread Rolf Turner
On 17/02/2009, at 10:54 AM, dimitris kapetanakis wrote: Dear all, I am trying to estimate the prediction from a fixed effects model and their confidence intervals as well. Though I do not want to include in the prediction and at the confidence intervals the intercept. For that reason I

Re: [R] problem of local ! :-(

2009-02-16 Thread Gabor Grothendieck
The Date class does not work with times and neither it nor the chron dates and times classes use time zones so that cannot be the problem if you are using those classes. Much of this is discussed in R News 4/1. On Mon, Feb 16, 2009 at 4:05 PM, Suresh_FSFM suresh.ghals...@gmail.com wrote: Dear

Re: [R] controlling number of decimals printed in anova tables?

2009-02-16 Thread Michael Friendly
Thanks, Gabor No, that wasn't it at all. In print.anova, I found: if (length(i - grep(Df$, cn))) zap.i - zap.i[!(zap.i %in% i)] so it only recognizes Df, not df as a column name prefix to print as integers. -Michael Gabor Grothendieck wrote: Or safer: df - as.integer(round(...))

Re: [R] Alternate to for-loop

2009-02-16 Thread Stefan Evert
A couple of remarks on vQ's naive benchmark: f.rep = function(n, m) replicate(n, rnorm(m)) I suppose you meant f.rep = function(n, m) replicate(n, mean(rnorm(m))) which doesn't make a substantial speed difference, though. f.pat = function(n, m) colMeans(array(rnorm(n*m), c(n,

[R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread Neotropical bat risk assessments
I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x - chron(dates = c(02/27/92, 02/27/92, 01/14/92, 02/28/92), I have activity plots by time on the y-axis and the dates on the x-axis. What I

Re: [R] Applying functions to partitions

2009-02-16 Thread Stavros Macrakis
On Mon, Feb 16, 2009 at 4:23 PM, Martin Morgan mtmor...@fhcrc.org wrote: Stavros Macrakis macra...@alum.mit.edu writes: matrix(tapply(mm, outer(rfact,cfact,paste), mean), length(unique(rfact))) or the variant idx - outer(rfact, (cfact - 1) * max(rfact), +)

Re: [R] Applying functions to partitions

2009-02-16 Thread Bert Gunter
... I suppose the clean way to do this would be to define a cartesian product of two factors with the induced lexicographic order (is there a standard function for doing this?): Of course. ?interaction. -- Bert Gunter Genentch __

Re: [R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread David Winsemius
On Feb 16, 2009, at 6:11 PM, Neotropical bat risk assessments wrote: I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x - chron(dates = c(02/27/92, 02/27/92, 01/14/92, 02/28/92), On my

[R] Time series prediction

2009-02-16 Thread dan ben moshe
I am trying to predict time series.  I have several samples which consist of measurement of 4 different variables over different time periods, and other measurements over subsequent time periods which I believe is predicted by the 4 variables. I am thinking of using cluster analysis, to confirm

Re: [R] PDF append help

2009-02-16 Thread somewhereondearth
Hi, I need to append my multiple plots in pdf files. my problem is that I would want to run the R script a number times(closing and opening) and still want to append. If i keep the dev.off() it wouldnt let me see my plots while R is open. any idea!! Jorge Ivan Velez wrote: Hi Ramya,

[R] Problems with labeling a set X axis in chron plots

2009-02-16 Thread B. Miller
I am having difficulties getting the X-axis labels (dates) to be as needed when plotting from chron The help syntax from chron lists this example: x - chron(dates = c(02/27/92, 02/27/92, 01/14/92, 02/28/92), I have activity plots by time on the y-axis and the dates on the x-axis. What I

  1   2   >