Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-04 Thread yrosseel
On 04/03/2011 09:38 PM, jouba wrote: Daer all, I have a question concerning longitudinal data: When we have a longitudinal data and we have to do sem analysis there is in the package lavaan some functions,options in this package that help to do this or we can treat these data like non longitudin

[R] multiple variables Y and X

2011-04-04 Thread Rosario Garcia Gil
Hello I have a model with several hundred Y variables, and also several 1000 X variables. The model is linear lm(Y ~ X). My questions are: 1.- how to avoid writing all Xs variables? is list() the right function? 2.- about the multiple Ys with dependence among some of them, how to incorporate t

Re: [R] MySql Versus R

2011-04-04 Thread Henri Mone
Dear All, Thank you to all of you for your fast reply. I will run the test and subscribe to the R-sig-db list. Cheers, Henri __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] RmetricsTools.R

2011-04-04 Thread Martin Maechler
> "LFP" == Luis Felipe Parra > on Mon, 4 Apr 2011 14:32:32 +0800 writes: LFP> Hello I read on the Rmetrics webpage that all the LFP> development packages could be intalled using the LFP> following command LFP> source("RmetricsTools.R") LFP> install.RmetricsDev("[

Re: [R] Error in "color2D.matplot" : "Error in plot.new() : figure margins too large"

2011-04-04 Thread Jim Lemon
On 04/03/2011 10:02 PM, shahab wrote: Hi, I am using color2D.matplot (...) function of "plotrix" package. I used a matrix of size around 20*20 However, apparently it failed to visualize the matrix and gave the following exception, which I don't have any idea about possible source of this error.

[R] svd

2011-04-04 Thread nuncio m
Dear list, I searched the libraries but could not find means to compute the svd of a coupled field. Is it possible in R Thanks nuncio -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma Goa-403804 [[alternative HTML ve

Re: [R] power of 2 way ANOVA with interaction

2011-04-04 Thread peter dalgaard
On Apr 4, 2011, at 01:10 , Timothy Spier wrote: > > I've been searching for an answer to this for a while but no joy. I have a > simple 2-way ANOVA with an interaction. I'd like to determine the power of > this test for each factor (factor A, factor B, and the A*B interaction). How > can I do

Re: [R] svd

2011-04-04 Thread nuncio m
Thanks juan, I got that, but what I have two matrices A and B, How can an svd be performed on the two together. Is it correct to get the covariance matrix and then perform the svd on the covariance matrix. If that is the case I have another doubt. I understand the covariance of A and B is t(A)%*

Re: [R] multiple variables Y and X

2011-04-04 Thread Carlos Ortega
Hello, You can do that like in the example included in the function step() lm1 <- lm(Fertility ~ ., data = swiss) But my advise is that prior to doing that, you should check this old thread in this list: http://tolstoy.newcastle.edu.au/R/e4/help/08/02/2842.html Regards, Carlos Ortega www.qua

Re: [R] Support Counting

2011-04-04 Thread Petr Savicky
On Mon, Apr 04, 2011 at 01:11:37AM -0500, psombe wrote: > Hi, >I'm new to R and trying to some simple analysis. I have a data set with > about 88000 transactions and i want to perform a simple support count > analysis of an itemset which is say not a complete transaction but a subset > of a tra

Re: [R] another question on shapefiles and geom_point in ggplot2

2011-04-04 Thread ahmadou dicko
Hi all Just as Pierre pointed out, i used rgeos instead of gpclib (the licence is less restrictive even though i'm still students). A since the last release the rgeos package seems to work well. I'm really disapointed by the fact that some packages (e.g adehabitatMA which is great thank's M. Caleng

[R] Deriving formula with deriv

2011-04-04 Thread kitty
Dear list, Hi, I am trying to get the second derivative of a logistic formula, in R summary the model is given as : ### >$nls >Nonlinear regression model >model: data ~ logistic(time, A, mu, lambda, addpar) >data: parent.frame() > A mu lambda >0.53243 0.03741 6.94296 ### but I

[R] add zero in front of numbers

2011-04-04 Thread Yan Jiao
Dear R users, I need to add 0 in front of a series of numbers, e.g. 1->001, 19->019, Is there a fast way of doing that? Many thanks yan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

Re: [R] add zero in front of numbers

2011-04-04 Thread Luis Ridao
Have a look at ?formatC On Mon, Apr 4, 2011 at 11:35 AM, Yan Jiao wrote: > Dear R users, > > I need to add 0 in front of a series of numbers, e.g. 1->001, 19->019, > Is there a fast way of doing that? > > Many thanks > > yan > >[[alternative HTML version deleted]] > > __

Re: [R] principal components

2011-04-04 Thread Gavin Simpson
On Fri, 2011-04-01 at 11:52 +0530, nuncio m wrote: > HI all, > I am trying to compute the EOF of a matrix using prcomp but unable to get > the expansion co-efficients. > is it possible using prcomp or are there any other methods > thanks > nuncio > *sigh* > RSiteSearch("EOF") It is at times li

[R] Clarks 2Dt function in R

2011-04-04 Thread bialozyt
Dear Ben, you answerd to Nancy Shackelford about Clarks 2Dt function. Since the thread ended just after your reply, I would like to ask, if you have an idea how to use this function in R I defined it the following way: function(x , p, u) { (p/(pi*u))*(1+(x^2/u))^(p+1) } and would like to fit

[R] Please help

2011-04-04 Thread Sadaf Zaidi
Dear Sir/Madam, I am stuck with a nagging problem in using R for SVM regression. My data has 5 dimensions and 400 observations. The independent variables are : Peb, Ksub, Sub, and Xtt. The dependent variable is: Rexp. I tried using the svm.tune function to tune the hyper parameters: gamma, epsilon

[R] Problem using svm.tune

2011-04-04 Thread sadaf zaidi
Dear Sir, I am stuck with a nagging problem in using R for SVM regression. My data has 5 dimensions and 400 observations. The independent variables are : Peb, Ksub, Sub, and Xtt. The dependent variable is: Rexp. I tried using the svm.tune function as well as <_tune(svm.), to tune the hyper p

[R] ticklabs in scatterplot3d

2011-04-04 Thread suparna mitra
Hello, I am having a problem to control ticklabs in scatterplot3d. When I am using it for small data then it is working fine. But with my big data all the labels are misplaced (one upon another). For example see the code below (I have just modified the scatterplot3d example to show my problem ). =

Re: [R] add zero in front of numbers

2011-04-04 Thread January Weiner
Dear Yan, apart from formatC, you can also use sprintf, which works almost exactly like the C sprintf function. To convert an integer x to a string with 5 leading 0s, you do: sprintf( "%05d", x ) Best regards, j. On Mon, Apr 4, 2011 at 12:35 PM, Yan Jiao wrote: > Dear R users, > > I need to a

[R] lattice: how to "center" a subtitle?

2011-04-04 Thread Marius Hofert
Dear expeRts, I recently asked for a real "centered" title (see, e.g., http://tolstoy.newcastle.edu.au/R/e13/help/11/01/0135.html). A nice solution (from Deepayan Sarkar) is to use "xlab.top" instead of "main": library(lattice) trellis.device("pdf") print(xyplot(0 ~ 0, xlab.top = "This title i

[R] system() command in R

2011-04-04 Thread rasanpreet kaur suri
Hi all, I have a local server insalled on my system and have to start that from within my R function. here is how I start it: cmd<-"sh start-server.sh" system(cmd, wait=FALSE) My function has to start the server and proceed with further steps. The server starts but the further steps of the prog

Re: [R] another question on shapefiles and geom_point in ggplot2

2011-04-04 Thread Manuel Spínola
Thank you Ahmadou, I got an error when I change fill to colour: > p + geom_point(aes(size = ACE, colour = ACE)) + theme_bw() + + scale_size(to = c(3, 15), name = "Número de especies", breaks = c(10, 40, 70, 100, 130, 160, 190, 220, 250)) + + scale_colour_gradientn(name = 'Número de especies',

[R] moving mean and moving variance functions

2011-04-04 Thread Steve Friedman
Hello Lets say as an example I have a dataframe with the following attributes: rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year) and foragePotential (0:1, by 0.01). The data is actually stored in a netcdf file and I'm trying to provide a conceptual version of the data.

[R] Examples of web-based Sweave use?

2011-04-04 Thread carslaw
I appreciate that this is OT, but I'd be grateful for pointers to examples of where Sweave has been used for web-based applications. In particular, examples of where reports/analyses are produced automatically through submission of data to a web-sever. I am mostly interested in situations wher

Re: [R] hc2Newick is different than th hclust dendrogram

2011-04-04 Thread Jose Hleap Lozano
Hi R helpers... I am having troubles because of the discrepancy between the dendrogram plotted from hclust and what is wrote in the hc2Newick file. I've got a matrix C: hc <- hclust(dist(C)) plot(hc) with the: write(hc2Newick(hc),file='test.newick') both things draw completely different "trees

Re: [R] I think I just broke R

2011-04-04 Thread Thomas Rusch
> >> and time to upgrade R > > I'm still fighting to find out how to upgrade stuff on Ubuntu. After > a > repository update the newest available version was still 2.10.1. > I'll figure it out, sooner or later :) > That's simple. Just add $deb http:///bin/linux/ubuntu maverick/ to /etc/apt

Re: [R] moving mean and moving variance functions

2011-04-04 Thread Gabor Grothendieck
On Mon, Apr 4, 2011 at 8:30 AM, Steve Friedman wrote: > Hello > > > Lets say as an example I have a dataframe with the following attributes: > rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year) > and foragePotential (0:1, by 0.01).  The data is actually stored in a netcdf

Re: [R] RGtk2: How to populate an GtkListStore data model?

2011-04-04 Thread Michael Lawrence
On Sun, Apr 3, 2011 at 8:29 PM, Cleber N. Borges wrote: > hello all > I am trying to learn how to use the RGtk2 package... > so, my first problem is: I don't get the right way for populate my > gtkListStore object! > any help is welcome... because I am trying several day to mount the code... > Tha

Re: [R] Examples of web-based Sweave use?

2011-04-04 Thread Tal Galili
I've written about a bunch of Web R interfaces here: * http://www.r-statistics.com/2010/04/jeroen-oomss-ggplot2-web-interface-a-new-version-released-v0-2/ * http://www.r-statistics.com/2010/04/r-node-a-web-front-end-to-r-with-protovis/ (And some other posts here: http://www.r-statistics.com/categor

[R] How to speed up grouping time series, help please

2011-04-04 Thread Den Alpin
I retrieve for a few hundred times a group of time series (10-15 ts with 1 values each), on every group I do some calculation, graphs etc. I wonder if there is a faster method than what presented below to get an appropriate timeseries object. Making a query with RODBC for every group I get a d

[R] reading from text file that have different rowlength and create a data frame

2011-04-04 Thread Ram H. Sharma
Hi R-experts I have many text files to read and combined them into one into R that are output from other programs. My textfile have unbalanced number of rows for example: ;this is example ; r help Var1 Var2 Var3 Var4 Var5 0 0.05 0.0112 1 0.04

[R] gap.barplot doesn't support data arrays?

2011-04-04 Thread Andrew D. Steen
I am trying to make a barplot with a broken axis using gap.barplot (in the indispensable plotrix package). This works well when the data is a vector: > twogrp<-c(rnorm(10)+4,rnorm(10)+20) > gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20),ylab="Group values",main="Barplot with gap")

Re: [R] reading from text file that have different rowlength and create a data frame

2011-04-04 Thread jim holtman
?read.table Then look at the 'fill' & 'flush' parameters; this may do the trick On Mon, Apr 4, 2011 at 9:32 AM, Ram H. Sharma wrote: > Hi R-experts > > I have many text files to read and combined them into one into R that are > output from other programs. My textfile have unbalanced number of ro

Re: [R] Difference in mixture normals and one density

2011-04-04 Thread Jim Silverton
Hello, I am trying to find out if R can do the following: I have a mixture of normals say f = 0.2*Normal(2, 5) + 0.8*Normal(3,2) How do I find the difference in the densities at any particular point of f and at Normal(2,5)? -- Thanks, Jim. [[alternative HTML version deleted]] _

Re: [R] reading from text file that have different rowlength and create a data frame

2011-04-04 Thread jim holtman
try this: > x <- read.table(textConnection(";this is example + ; r help + Var1 Var2 Var3 Var4 Var5 + 0 0.05 0.0112 + 1 0.04 0.0618A + 2 0.05 0.0814 + 3 0.01 0.0615 B + 4

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Joshua Ulrich
Hi Dan, On Mon, Apr 4, 2011 at 7:49 AM, Den Alpin wrote: > I retrieve for a few hundred times a group of time series (10-15 ts > with 1 values each), on every group I do some calculation, graphs > etc. I wonder if there is a faster method than what presented below to > get an appropriate time

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Gabor Grothendieck
On Mon, Apr 4, 2011 at 8:49 AM, Den Alpin wrote: > I retrieve for a few hundred times a group of time series (10-15 ts > with 1 values each), on every group I do some calculation, graphs > etc. I wonder if there is a faster method than what presented below to > get an appropriate timeseries ob

Re: [R] Difference in mixture normals and one density

2011-04-04 Thread Liaw, Andy
Is something like this what you're looking for? R> library(nor1mix) R> nmix2 <- norMix(c(2, 3), sig2=c(25, 4), w=c(.2, .8)) R> dnorMix(1, nmix2) - dnorm(1, 2, 5) [1] 0.03422146 Andy > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Beha

Re: [R] Please help

2011-04-04 Thread Steve Lianoglou
Hi, On Mon, Apr 4, 2011 at 5:15 AM, Sadaf Zaidi wrote: > Dear Sir/Madam, > I am stuck with a nagging problem in using R for SVM regression. My data has 5 > dimensions and 400 observations. The independent variables are : > Peb, Ksub, Sub, and Xtt. > The dependent variable is: Rexp. > I tried usin

Re: [R] gap.barplot doesn't support data arrays?

2011-04-04 Thread Peter Ehlers
On 2011-04-04 06:39, Andrew D. Steen wrote: I am trying to make a barplot with a broken axis using gap.barplot (in the indispensable plotrix package). This works well when the data is a vector: twogrp<-c(rnorm(10)+4,rnorm(10)+20) gap.barplot(twogrp,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20),y

[R] Creating multiple vector/list names-novice

2011-04-04 Thread michalseneca
Hi I have very simple issue as I am still new to the group of R I have basically vector of names for which i want to create mutliple combinations and then place them in different vectors. In some other language I can just place a third dimension to separate list (or matrix) but i do not know ho

Re: [R] Clarks 2Dt function in R

2011-04-04 Thread Ben Bolker
biologie.uni-marburg.de> writes: > > Dear Ben, > > you answerd to Nancy Shackelford about Clarks 2Dt function. > Since the thread ended just after your reply, > I would like to ask, if you have an idea how to use this function in R > Dear Ronald, I got started on your problem, but I didn

Re: [R] Creating multiple vector/list names-novice

2011-04-04 Thread Henrique Dallazuanna
Try this: lapply(2:3, FUN = combn, x = string, paste, collapse = '') On Mon, Apr 4, 2011 at 11:24 AM, michalseneca wrote: > Hi I have very simple issue as I am still new to the group of R > > I have basically > > vector of names for which i want to create mutliple combinations and then > place

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread David Winsemius
On Apr 4, 2011, at 7:39 AM, Marius Hofert wrote: Dear expeRts, I recently asked for a real "centered" title (see, e.g., http://tolstoy.newcastle.edu.au/R/e13/help/11/01/0135.html) . A nice solution (from Deepayan Sarkar) is to use "xlab.top" instead of "main": library(lattice) trellis.dev

[R] simulating a VARXls model using dse

2011-04-04 Thread Alison Callahan
Hello, Using the dse package I have estimated a VAR model using estVARXls(). I can perform forecasts using forecast() with no problems, but when I try to use simulate() with the same model, I get the following error: Error in diag(Cov, p) : 'nrow' or 'ncol' cannot be specified when 'x' is a mat

Re: [R] simulating a VARXls model using dse

2011-04-04 Thread Alison Callahan
Hi Paul, I am using R v. 2.12.2, and the "dse" package with build 2.12.2. I have attached some sample data to this email, and the R code I use to create the model and then forecast with it. Thanks, Alison On Mon, Apr 4, 2011 at 11:02 AM, Paul Gilbert wrote: > Could you please send me a reprod

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Den Alpin
I did some tests on Your and Gabor solutions, below my findings: - Your solution is fast as my solution in xts (below) but MUCH MORE READABLE, in particular I think your test should take into account xts creation from the data.frame (see below); - Gabor's solution with read.zoo is fast as xts but

Re: [R] Deriving formula with deriv

2011-04-04 Thread David Winsemius
On Apr 4, 2011, at 6:35 AM, kitty wrote: Dear list, Hi, I am trying to get the second derivative of a logistic formula, in R summary the model is given as : ### $nls Nonlinear regression model model: data ~ logistic(time, A, mu, lambda, addpar) data: parent.frame() A mu lambda 0.

Re: [R] D'Agostino test

2011-04-04 Thread Dieter Menne
Juraj17 wrote: > > Do I have to write my own, or it exists yet? How name has it, or how can I > use it. > Try the R-function search. It return the function you are looking for as the first match. Dieter -- View this message in context: http://r.789695.n4.nabble.com/D-Agostino-test-tp34249

Re: [R] How to speed up grouping time series, help please

2011-04-04 Thread Gabor Grothendieck
On Mon, Apr 4, 2011 at 11:20 AM, Den Alpin wrote: > I did some tests on Your and Gabor solutions, below my findings: > > - Your solution is fast as my solution in xts (below) but MUCH MORE > READABLE, in particular I think your test should take into account xts > creation from the data.frame (see

Re: [R] replace last 3 characters of string

2011-04-04 Thread Dieter Menne
Bert Jacobs-2 wrote: > > I would like to replace the last tree characters of the values of a > certain > column in a dataframe. > > Besides the mentioned standard method: I found the subset of string operations in Hadley Wickhams stringr package helpful. They have a much more consistent interf

Re: [R] gap.barplot doesn't support data arrays?

2011-04-04 Thread Andrew D. Steen
True - gapped stacked bar plots make no sense at all. I'm working my way up to a gapped bar plot with series next to each other (and error bars!), what you'd get if you put a gap in the y-axis of > twogrp2<-array(twogrp, dim=c(2,5)) > barplot(twogrp2, beside=TRUE) I'm guessing I can do this if

Re: [R] help

2011-04-04 Thread Vijayan Padmanabhan
Hi R Group Thanks for some suggestions. I have finally figured it out.. The following script called from within R Session does what i want..(to attach files called test1.pdf and Document-1.pdf into the file test2.pdf and then save the new file with attachments as test3.pdf at the given path) optio

[R] merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
Dear R community members I did find a good way to merge my 200 text data files in to a single data file with one column added will show indicator for that file. filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt .to K200cd.txt data_list <-lapply(f

[R] Adjusting p values of a matrix

2011-04-04 Thread January Weiner
Dear all, I have an n x n matrix of p-values. The matrix is symmetrical, as it describes the "each against each" p values of correlation coefficients. How can I best correct the p values of the matrix? Notably, the total number of the tests performed is n(n-1)/2, since I do not test the correlati

Re: [R] Creating multiple vector/list names-novice

2011-04-04 Thread michalseneca
Hi Thanks ,however I would need something different still... I would need to return a vector so if as to choose cc[[3]] [2] would return vector/list as in terms of c(b,d,e) Thanks -- View this message in context: http://r.789695.n4.nabble.com/Creating-multiple-vector-list-names-novic

[R] Multithreading of Geneland

2011-04-04 Thread Aurélien Chateigner
Hi all, I would like to multithread that script, to detect structure from multilocus genetic data : >library(Geneland) > >geno = read.table("cot966gen_test.txt") #the file is show after >MCMC(geno.dip.codom = geno, varnpop=T, npopmax=20, spatial = F, nit=10, >thinnin=100, path.mcmc="./") >P

Re: [R] Adjusting p values of a matrix

2011-04-04 Thread Bert Gunter
1. This is not an R question, AFAICS. 2. Sounds like a research topic. I don't think there's a meaningful simple answer. I suspect it strongly depends on the model and context. -- Bert On Mon, Apr 4, 2011 at 8:02 AM, January Weiner wrote: > Dear all, > > I have an n x n matrix of p-values. The

Re: [R] power of 2 way ANOVA with interaction

2011-04-04 Thread Greg Snow
You can use simulation: 1. decide what you think your data will look like 2. decide how you plan to analyze your data 3. write a function that simulates a dataset (common arguments include sample size(s) and effect sizes) then analyzes the data in your planned manner and returns the p-value(s) o

Re: [R] Adjusting p values of a matrix

2011-04-04 Thread peter dalgaard
On Apr 4, 2011, at 17:02 , January Weiner wrote: > Dear all, > > I have an n x n matrix of p-values. The matrix is symmetrical, as it > describes the "each against each" p values of correlation > coefficients. > > How can I best correct the p values of the matrix? Notably, the total > number of

Re: [R] Adjusting p values of a matrix

2011-04-04 Thread Spencer Graves
There are also the multcomp and multcompView packages that might provide something of interest in this regard. "multcomp" has a companion book, "Multiple Comparisons Using R" (Bretz, Hothorn, Westfall, 2010, CRC Press), which I believe provides an excellent overview of the state of the

Re: [R] add zero in front of numbers

2011-04-04 Thread Uwe Ligges
On 04.04.2011 12:35, Yan Jiao wrote: Dear R users, I need to add 0 in front of a series of numbers, e.g. 1->001, 19->019, Is there a fast way of doing that? formatC(c(1, 19), flag=0, width=3) Uwe Ligges Many thanks yan [[alternative HTML version deleted]] __

Re: [R] Adjusting p values of a matrix

2011-04-04 Thread Benno Pütz
How about as.matrix(p.adjust(as.dist(pmat))) Benno On 4.Apr.2011, at 17:02, January Weiner wrote: > Dear all, > > I have an n x n matrix of p-values. The matrix is symmetrical, as it > describes the "each against each" p values of correlation > coefficients. > > How can I best correc

Re: [R] merging data list in to single data frame

2011-04-04 Thread Uwe Ligges
On 04.04.2011 16:41, Umesh Rosyara wrote: Dear R community members I did find a good way to merge my 200 text data files in to a single data file with one column added will show indicator for that file. filelist = list.files(pattern = "K*cd.txt") I doubt you meant "K*cd.txt" but "^K[[:

Re: [R] 'RQuantLib for 2.12 version

2011-04-04 Thread Joshua Ulrich
Hi Mauricio, A Windows binary is now available on CRAN: http://dirk.eddelbuettel.com/blog/2011/04/04/#rquantlib_0.3.7 Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Tue, Mar 29, 2011 at 10:38 AM, Mauricio Romero wrote: > Dear R users, > > I have been trying to use RQuantLib i

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Marius Hofert
Dear David, I intended to use another x-label. But your suggestion brings me to the idea of just using a two-line xlab, so s.th. like print(xyplot(0 ~ 0, xlab.top = "This title is now 'centered' for the human's eye", xlab = "but subtitles are _now_ centered\nbla", scales = list(alternating = c(

Re: [R] converting affybatch object to matrix

2011-04-04 Thread Juliet Hannah
Use exprs on the output from RMA (or another method you like) library("affy") myData <-ReadAffy() myRMA <- rma(myData) e = exprs(myRMA) Also, check out the Bioconductor mailing list where Bioconductor-related topics are discussed. On Fri, Apr 1, 2011 at 9:54 AM, Landes, Ezekiel wrote: > I hav

[R] r-squared for object timeseries

2011-04-04 Thread user84
Hi, i am new in this forum. I hope someone can help me or correct me, if this is the false "subforum" to write this. I have to choose the "best" arima model from different possibilities of a timeseries. I know the AIC; BIC and similar. But now i would like to check the value called r-squared or a

Re: [R] Adjusting p values of a matrix

2011-04-04 Thread Spencer Graves
There are, however, the multcomp and multcompView packages that might provide something of interest in this regard. "multcomp" has a companion book, "Multiple Comparisons Using R" (Bretz, Hothorn, Westfall, 2010, CRC Press), which I believe provides an excellent overview of the state of

[R] Questions remaining: define any character as na.string RE: merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
Dear Uwe and R community members Thank you Uwe for the help. I have still a question remaining, I am trying to find answer from long time. While exporting my data, I have some characters mixed into it. I want to define any characters as na.string? Is it possible to do so? Thanks; Umesh

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread David Winsemius
On Apr 4, 2011, at 12:45 PM, Marius Hofert wrote: Dear David, I intended to use another x-label. But your suggestion brings me to the idea of just using a two-line xlab, so s.th. like print(xyplot(0 ~ 0, xlab.top = "This title is now 'centered' for the human's eye", xlab = "but subtitles a

[R] merging 2 frames while keeping all the entries from the "reference" frame

2011-04-04 Thread Dimitri Liakhovitski
Hello! I have my data frame "mydata" (below) and data frame "reference" - that contains all the dates I would like to be present in the final data frame. I am trying to merge them so that the the result data frame contains all 8 dates in both subgroups (i.e., Group1 should have 8 rows and Group2 to

Re: [R] Questions remaining: define any character as na.string RE: merging data list in to single data frame

2011-04-04 Thread David Winsemius
On Apr 4, 2011, at 12:37 PM, Umesh Rosyara wrote: Dear Uwe and R community members Thank you Uwe for the help. I have still a question remaining, I am trying to find answer from long time. While exporting my data, I have some characters mixed into it. I want to define any characters as

Re: [R] merging 2 frames while keeping all the entries from the "reference" frame

2011-04-04 Thread Dimitri Liakhovitski
To clarify just in case, here is the result I am trying to get: mydate group values 12/29/2008 Group1 0.453466522 1/5/2009Group1 NA 1/12/2009 Group1 0.416548943 1/19/2009 Group1 2.066275155 1/26/2009 Group1 2.037729638 2/2/2009Group1 -0.598040483 2/9

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Marius Hofert
Dear David, do you know how to get plotmath-like symbols in both rows? I tried s.th. like: lab <- expression(paste(alpha==1, ", ", beta==2, sep="")) xlab <- substitute(expression( atop(lab==lab., bold(foo)) ), list(lab.=lab)) xyplot(0 ~ 0, xlab = xlab) Cheers, Marius On 2011-04-04, at 18:59 ,

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread David Winsemius
On Apr 4, 2011, at 1:27 PM, Marius Hofert wrote: Dear David, do you know how to get plotmath-like symbols in both rows? I tried s.th. like: lab <- expression(paste(alpha==1, ", ", beta==2, sep="")) xlab <- substitute(expression( atop(lab==lab., bold(foo)) ), list(lab.=lab)) xyplot(0 ~ 0, x

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Peter Ehlers
On 2011-04-04 10:27, Marius Hofert wrote: Dear David, do you know how to get plotmath-like symbols in both rows? I tried s.th. like: lab<- expression(paste(alpha==1, ", ", beta==2, sep="")) xlab<- substitute(expression( atop(lab==lab., bold(foo)) ), list(lab.=lab)) xyplot(0 ~ 0, xlab = xlab)

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Henrique Dallazuanna
Maybe: xyplot(0 ~ 0, xlab = bquote(expression(atop(alpha==.(x)*","~beta==.(y), bold(foo) )) )) On Mon, Apr 4, 2011 at 2:58 PM, David Winsemius wrote: > > On Apr 4, 2011, at 1:27 PM, Marius Hofert wrote: > >> Dear David, >> >> do you know how to get plotmath-like symbols in both rows? >> I tried

[R] Granger Causality in a VAR Model

2011-04-04 Thread ivan
Dear Community, I am new to R and have a question concerning the causality () test in the vars package. I need to test whether, say, the variable y Granger causes the variable x, given z as a control variable. I estimated the VAR model as follows: >model<-VAR(cbind(x,y,z),p=2) Then I did the fol

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Marius Hofert
Dear all, many thanks, that helped a lot! Cheers, Marius On 2011-04-04, at 19:58 , David Winsemius wrote: > > On Apr 4, 2011, at 1:27 PM, Marius Hofert wrote: > >> Dear David, >> >> do you know how to get plotmath-like symbols in both rows? >> I tried s.th. like: >> >> lab <- expression(pa

[R] automating regression or correlations for many variables

2011-04-04 Thread geral
Dear All, I have a large data frame with 10 rows and 82 columns. I want to apply the same function to all of the columns with a single command. e.g. zl <- lm (snp$a_109909 ~ snp$lat) will fit a linear model to the values in lat and a_109909. What I want to do is fit linear models for the values i

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-04-04 Thread jouba
Thanks you for your response For lavaan package can i have more information about this example you have applied in the section 7 the meanings of The variables (c1,c2,c3,c4, i ,s ,x1,x2) I think i have need more information to learn more about how able to apply growth model in my data (long

Re: [R] merging 2 frames while keeping all the entries from the "reference" frame

2011-04-04 Thread Gabor Grothendieck
On Mon, Apr 4, 2011 at 1:09 PM, Dimitri Liakhovitski wrote: > Hello! > I have my data frame "mydata" (below) and data frame "reference" - > that contains all the dates I would like to be present in the final > data frame. > I am trying to merge them so that the the result data frame contains > all

Re: [R] merging 2 frames while keeping all the entries from the "reference" frame

2011-04-04 Thread Henrique Dallazuanna
Try this: merge(mydata, cbind(reference, group = rep(unique(mydata$group), each = nrow(reference))), all = TRUE) On Mon, Apr 4, 2011 at 2:24 PM, Dimitri Liakhovitski wrote: > To clarify just in case, here is the result I am trying to get: > > mydate  group   values > 12/29/2008      Group1  0.4

Re: [R] merging data list in to single data frame

2011-04-04 Thread Dennis Murphy
Hi: Here's an alternative using ldply() from the plyr package. The idea is to read the data frames into a list, name them accordingly and then call ldply(). # Read in the test data frames (you want to use list.files() instead to input the data per Uwe's guidelines) df1 <- read.table(textConnectio

Re: [R] automating regression or correlations for many variables

2011-04-04 Thread Dennis Murphy
Hi: Here's a small example: > df <- data.frame(y1 = rnorm(10), y2 = rnorm(10), y3 = rnorm(10), lat = rnorm(10)) > m <- lm(cbind(y1, y2, y3) ~ lat, data = df) > summary(m) The LHS of the model formula needs to be a matrix. In your case, something like m <- lm(as.matrix(snp[, -1]) ~ lat, data =

Re: [R] zoo:rollapply by multiple grouping factors

2011-04-04 Thread Gabor Grothendieck
On Mon, Apr 4, 2011 at 3:40 PM, Mark Novak wrote: > Thank you very much Gabor!  It looks like that's gonna work wonderfully.  I > didn't even know 'ave' existed. > > For others out there:  I only needed to add a comma:   dat[,c("Site", > "Plot", "Sp")] Actually, if dd is a data frame dd[, ix] and

Re: [R] Linear Model with curve fitting parameter?

2011-04-04 Thread Steven McKinney
> -Original Message- > From: stephen sefick [mailto:ssef...@gmail.com] > Sent: April-03-11 5:35 PM > To: Steven McKinney > Cc: R help > Subject: Re: [R] Linear Model with curve fitting parameter? > > Steven: > > You are exactly right sorry I was confused. > > >

Re: [R] zoo:rollapply by multiple grouping factors

2011-04-04 Thread Mark Novak
Thank you very much Gabor! It looks like that's gonna work wonderfully. I didn't even know 'ave' existed. For others out there: I only needed to add a comma: dat[,c("Site", "Plot", "Sp")] Small follow up Q: Is there any reason to use 'aggregate' vs. 'ave' in general? -mark On 4/3/1

[R] General binary search?

2011-04-04 Thread Stavros Macrakis
Is there a generic binary search routine in a standard library which a) works for character vectors b) runs in O(log(N)) time? I'm aware of findInterval(x,vec), but it is restricted to numeric vectors. I'm also aware of various hashing solutions (e.g. new.env(hash=TRUE) and fastmatch), but

Re: [R] merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
Thank you Dennis for the solution. It is a step ahead..However I need to read all 200 files as dataframes one-by-one. Can we automate this process. I used the following step to read all file at once however the data_list ended as list. filelist = list.files(pattern = "K*cd.txt") # the file na

Re: [R] automating regression or correlations for many variables

2011-04-04 Thread geral
Thanks! I must confess I am just a beginner, but I followed your suggestion and did 'm <- lm(as.matrix(snp[, -1]) ~ lat, data = snp) ' and it worked perfectly. I would like to understand what is being done here. as.matrix I understand makes my data frame be a matrix, but I don't understand the pa

Re: [R] General binary search?

2011-04-04 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Stavros Macrakis > Sent: Monday, April 04, 2011 1:15 PM > To: r-help > Subject: [R] General binary search? > > Is there a generic binary search routine in a standard library whic

Re: [R] moving mean and moving variance functions

2011-04-04 Thread skfgla...@gmail.com
Thanks, I had recently seen reference to caTools but had forgotten about it. Much appreciated. friedman.st...@gmail.com 517-648-6290 -Original message- From: Gabor Grothendieck To: Steve Friedman Cc: r-help@r-project.org Sent: Mon, Apr 4, 2011 13:17:36 GMT+00:00 Subject: Re: [R] movin

[R] how to handle no lines in input with pipe()

2011-04-04 Thread Andrew Yee
This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using pipe() and read.csv() as follows: read.csv(pipe('grep foo bar.csv')) However, is there a way to have this command run when for example, there is no "foo" text in the bar.csv file? I get an error messag

[R] AIC for robust regression

2011-04-04 Thread James Warren Shaw
I am interested in comparing the fit of robust (i.e., S and MM) and non-robust (i.e., OLS) estimators when applied to a particular data set. The paper entitled "A comparison of robust versions of the AIC based on M, S and MM-estimators" (available at: http://ideas.repec.org/p/ner/leuven/urnhdl12345

Re: [R] how to handle no lines in input with pipe()

2011-04-04 Thread Prof Brian Ripley
On Mon, 4 Apr 2011, Andrew Yee wrote: This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using pipe() and read.csv() as follows: read.csv(pipe('grep foo bar.csv')) However, is there a way to have this command run when for example, there is no "foo" text in

[R] RODBC excel - need to preserve (or extract) numeric column names

2011-04-04 Thread Folkes, Michael
I'm using RODBC to read an excel file (not mine!). But I'm struggling to find a way to preserve the column names that have a numeric value. sqlFetch() drops the value and calls them f1, f2, f3,... (ie field number). this is a different approach from read.csv, which will append "V" prior to th

Re: [R] merging data list in to single data frame

2011-04-04 Thread Hadley Wickham
> filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt > .to K200cd.txt It's very easy: names(filelist) <- basename(filelist) data_list <- ldply(filelist, read.table, header=T, comment=";", fill=T) Hadley -- Assistant Professor / Dobelman Family Junior Cha

  1   2   >