Re: [R] how to generalize the arguments for lm() (r-h...@lists.r-project.org)

2008-12-27 Thread Dimitris Rizopoulos
you can just use a design matrix on the right hand side of 'formula', e.g., factors <- matrix(rnorm(100*10), 100, 10) y <- rnorm(100) lm(y ~ factors) I hope it helps. Best, Dimitris Math Girl wrote: Hello, How could I generalize the following statement for an arbitrary number of columns

[R] how to generalize the arguments for lm() (r-h...@lists.r-project.org)

2008-12-27 Thread Math Girl
Hello, How could I generalize the following statement for an arbitrary number of columns instead of 7? result[[i]]<-lm( returns[,i] ~ factors[,1] + factors[,2] + factors[,3] + factors[,4] + factors[,5] + factors[,6] + factors[,7] ) Thank you, Mathgurl [[alternative HTML vers

Re: [R] Conditional operation on multiple columns from two data frames

2008-12-27 Thread Tim Sippel
Sorry...I was unaware I needed to 'deput' to deparse data examples into a useful format. The data examples I provided initially are deparsed below: df1<- list(ID = c(2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3), Date = c("2007-05-30 18:48:20", "2007-05-30 20:21:56", "2007-06-02 09:39:58", "2007-06-02 1

[R] Conditional operation on multiple columns from two data frames

2008-12-27 Thread Tim Sippel
Hi- I have two data frames for which I wish to conditionally subtract the values of one dataframe from the other. I want to subtract df1$x from df2$x when their id is equal and the absolute value of difference between the dates is 12 hours or less. If there is no match of equal id's and dates le

[R] Using a constant scale across X-Y plots

2008-12-27 Thread Lisa
I am working off an example from Deepayan Sarkar's Lattice:Multivariate Data Visualiization with R. I am trying to create Figure 5.6, essentially, but I would like to be able depict different metro areas. These of course have different lat/longs, so I need to make different graphs. BUT (

[R] Time Series Filtering

2008-12-27 Thread stephen sefick
I would like to isolate a certain frequency in a signal. Does anyone know of a package that uses wavelet filtering to accoplish this task. -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up

Re: [R] Object name vectcor as function input argument?

2008-12-27 Thread Stavros Macrakis
On Sat, Dec 27, 2008 at 1:32 PM, Sean Zhang wrote: > My question: How to use a character vector that records object names as > function input argument? > ... > I asked this question very recently and was advised to use get(). get() > works when passing one single object name. but it does not work

Re: [R] Object name vectcor as function input argument?

2008-12-27 Thread Charles C. Berry
On Sat, 27 Dec 2008, Sean Zhang wrote: Dear R-helpers: I am new to R and ran into the following question and would appreicate your advice very much. My question: How to use a character vector that records object names as function input argument? I asked this question very recently and was adv

[R] Plot layout help?

2008-12-27 Thread rkevinburton
I am trying to visualize a dataset and I think I almost have it but I need some assistance. THe following commands: library("forecast") library("expsmooth") plot(carparts[,2001:2010],main="Monthly car part sales",xlab="Year") The last plot command puts 10 graphs on one page with the y axis lab

Re: [R] overwrite title

2008-12-27 Thread Uwe Ligges
Carl Witthoft wrote: I have played with overwriting text on charts by using 'white' text and various other tricks. As David W. said, there's usually a slight ghost left behind. My recommendation would be first and foremost to set up a miniscript to regenerate your plot, and change the title

Re: [R] about randomForest

2008-12-27 Thread Jim Porzak
Hi Wanghong, Unless you have a huge linux box, you will need to sample down your 300k rows to a few thousand. In marketing aps, I often have data sets of comparable size. I would suggest you start with a just a few k rows to make sure everything else is working as you wish. Also, study carefully

Re: [R] overwrite title

2008-12-27 Thread Carl Witthoft
I have played with overwriting text on charts by using 'white' text and various other tricks. As David W. said, there's usually a slight ghost left behind. My recommendation would be first and foremost to set up a miniscript to regenerate your plot, and change the title text to whatever you rea

[R] Object name vectcor as function input argument?

2008-12-27 Thread Sean Zhang
Dear R-helpers: I am new to R and ran into the following question and would appreicate your advice very much. My question: How to use a character vector that records object names as function input argument? I asked this question very recently and was advised to use get(). get() works when passin

[R] parameter "i" in "mfg" is out of range

2008-12-27 Thread cgenolin
Hi the list, and merry christmas ! I am using some screen tool (screen, split.screen, close.screen) and at some point, I get an error : parameter "i" in "mfg" is out of range What does in mean ? How can I correct it ? On the web, I find an old message from Giovanni that suggest to erase all

Re: [R] Simulating dataset using Parallel Latent CTT model?

2008-12-27 Thread William Revelle
Nidhi, As I said in my previous response, if you want 20 items with equal factor loadings you can just specify the loading: e.g., for all loadings of .6 GenData <- congeneric.sim(N=500, loads = rep(.6,20), short = FALSE) The error variances will all be equal to 1 - loading^2 where loading i

Re: [R] starting values update

2008-12-27 Thread Uwe Ligges
Peter Dalgaard wrote: Uwe Ligges wrote: Nadine Mugusa wrote: Hi all, does anyone know how to automatically update starting values in R? See ?set.seed Off target, Uwe. Right, thanks and apologies, haven't read carefully enough Uwe This was about starting values for a nonlinear

Re: [R] starting values update

2008-12-27 Thread Peter Dalgaard
Uwe Ligges wrote: Nadine Mugusa wrote: Hi all, does anyone know how to automatically update starting values in R? See ?set.seed Off target, Uwe. This was about starting values for a nonlinear fit. More likely something about self-starting models is relevant here. There's a chapter in the

Re: [R] Want to create empty vectors inside a empty data frame

2008-12-27 Thread Uwe Ligges
Yes, you can add empty vectors, if you really need (I doubt you need): cat_record_mean_dfs <- data.frame() cat_record_mean_dfs[[paste("recmeanC", 1, sep="")]] <- numeric(0) Best, Uwe Ligges Moumita Das wrote: Hi All, I want to create empty vectors inside an empty data frame.The name of th

Re: [R] indexed expression

2008-12-27 Thread Uwe Ligges
bernardo lagos alvarez wrote: Hello expeRts, I need generate symbolize the autocovariances matrix of a Gaussian ARMA(1,1), for derivate it and evaluate. I try this codes, but whitout sucess vacv<-NULL vacv[1]<-expression(1-2*phi*theta-theta^2) vacv[2]<-(1-phi*theta)*(phi-theta) vacv[3:n]<-

Re: [R] starting values update

2008-12-27 Thread Uwe Ligges
Nadine Mugusa wrote: Hi all, does anyone know how to automatically update starting values in R? See ?set.seed Uwe Ligges I' m fitting multiple nonlinear models and would like to know how I can update starting values without having to type them in. thank all --- On Fri, 12/26/08, r-help

Re: [R] about randomForest

2008-12-27 Thread Uwe Ligges
wanghong wrote: hello, I want to use randomForest to classify a matrix which is 331030×42,the last column is class signal.I use : Memebers.rf<-randomForest(class~.,data=Memebers,proximity=TRUE,mtry=6,ntree=200) which told me" the error is matrix(0,n,n) set too elements" I doubt "the error i

Re: [R] Need Help urgently - evaluating regressor using R

2008-12-27 Thread Uwe Ligges
Karen Goh wrote: Hi there, Could anybody out there advise me the code to evaluate the contribution of each regressor to the model using the t-test with 5% significance level. Here are the co-efficients of the regressors. pitch 0.841000 Temp 1394.25 Soaktim

Re: [R] Need Help on r-programming

2008-12-27 Thread Uwe Ligges
Karen Goh wrote: Hi, I would like to know how do I use R to evaluate the contribution of each regressor to a model using t-test with 5% significance level? What kind of model? I guess a simple linear regression model? I have attached a file which I have completed and am stuck at that qu

Re: [R] contour plot - smooth lines

2008-12-27 Thread Uwe Ligges
tommaso.lette...@unifi.it wrote: Dear R-Users, I am using 'contour' to plot a graph using values x,y and a matrix z. I would like to obtain 'smooth lines' instead of no-smooth contour lines. I tried with filled.contour too. In a Post I found yy <-predict(interpSpline(x, y)) I could use that met

Re: [R] question about SNA in R, thanks!

2008-12-27 Thread Gábor Csárdi
Please stay on the list to make the archive more useful. Here is the conclusion of the thread. Gabor On Sat, Dec 27, 2008 at 2:59 PM, Weijia You wrote: > Sorry to trouble you, but I have got the answer to this problem. > When I turn "el <- get.edgelist(g)" to "el <- get.edgelist(g,names=FALSE)",

Re: [R] Simulating dataset using Parallel Latent CTT model?

2008-12-27 Thread Nidhi Kohli
Hi Bill, Thank you very much for your response. You are right, I want to simulate data set for 500 examinees across 20 items using Parallel latent CTT model. As you know in Parallel Latent CTT model all the error variances and factor loadings are equal across all the items. Could you please le

[R] Want to create empty vectors inside a empty data frame

2008-12-27 Thread Moumita Das
Hi All, I want to create empty vectors inside an empty data frame.The name of the vectors has to come dynamically. For example if record_mean is my empty data frame,and i have say 4 categories,the category names for record mean data frame has to recmeanC1,recmeanC2,recmeanC3,recmeanC4,which will b

Re: [R] Question about regression without an intercept

2008-12-27 Thread John Fox
Dear Ajay, The reason isn't mysterious: the fitted values from both models are linear functions of x (without error), and hence are perfectly correlated with each other and have the same correlation with anything else -- including y -- that x does. Try plotting fitted(m1) vs. fitted(m2). Regards,

[R] indexed expression

2008-12-27 Thread bernardo lagos alvarez
Hello expeRts, I need generate symbolize the autocovariances matrix of a Gaussian ARMA(1,1), for derivate it and evaluate. I try this codes, but whitout sucess vacv<-NULL vacv[1]<-1-2*phi*theta-theta^2 vacv[2]<-(1-phi*theta)*(phi-theta) vacv[3:n]<-acv[2]*(phi^(1:(n-2))) facv<-list() for(i in

Re: [R] question about SNA in R, thanks!

2008-12-27 Thread Gábor Csárdi
Weijia see ?degree for the degree and ?cor for the correlation. E.g. mixing <- function(g) { el <- get.edgelist(g) deg <- degree(g) cor(deg[el[,1]+1], deg[el[,2]+1]) } You need to modify the degree() call to take edge direction into account. Gabor ps. FYI, there is also an igraph missing

Re: [R] how to plot implicit functions

2008-12-27 Thread Fabrizio Berloco
If you are lucky, try draw3d function of maxima: (http://www.telefonica.net/web2/biomates/maxima/gpdraw/) load(draw); draw3d(implicit(2=(cos(x+%phi*y)+cos(x-%phi*y)+cos(y+%phi*z)+cos(y-%phi*z)+cos(z-%phi*x)+cos(z+%phi*x)),x,-4,4,y,-4,4,z,-4,4), enhanced3d = true, palette =

[R] starting values update

2008-12-27 Thread Nadine Mugusa
Hi all, does anyone know how to automatically update starting values in R? I' m fitting multiple nonlinear models and would like to know how I can update starting values without having to type them in. thank all --- On Fri, 12/26/08, r-help-requ...@r-project.org wrote: From: r-help-requ...@r-

[R] Need Help urgently - evaluating regressor using R

2008-12-27 Thread Karen Goh
Hi there, Could anybody out there advise me the code to evaluate the contribution of each regressor to the model using the t-test with 5% significance level. Here are the co-efficients of the regressors. pitch 0.841000 Temp 1394.25 Soaktime3.557340 Soakpct

[R] question about SNA in R, thanks!

2008-12-27 Thread Weijia You
Dear colleagues, I'm trying to have a look at the Assortative and Disassortative ( http://en.wikipedia.org/wiki/Assortative_mixing) of the network I have. But it seems that the igraph hasn't mentioned that yet. I have to get the in/out degree of the vertices of each edge and calculate the Pearson

[R] about randomForest

2008-12-27 Thread wanghong
hello, I want to use randomForest to classify a matrix which is 331030×42,the last column is class signal.I use : Memebers.rf<-randomForest(class~.,data=Memebers,proximity=TRUE,mtry=6,ntree=200) which told me" the error is matrix(0,n,n) set too elements" then I use: Memebers.rf<-randomForest(clas

[R] question about Assortative and Disassortative Mixing

2008-12-27 Thread Weijia You
Dear colleagues, I'm trying to have a look at the Assortative and Disassortative( http://en.wikipedia.org/wiki/Assortative_mixing) of the network I have. But it seems that the igraph hasn't mentioned that yet. I have to get the in/out degree of the vertices of each edge and calculate the Pearson'

[R] Need Help on r-programming

2008-12-27 Thread Karen Goh
Hi, I would like to know how do I use R to evaluate the contribution of each regressor to a model using t-test with 5% significance level? I have attached a file which I have completed and am stuck at that question. __ R-help@r-project.org ma

Re: [R] how to plot implicit functions

2008-12-27 Thread Fabrizio Berloco
YIHSU CHEN-3 wrote: > > Dear R users -- > > I think this question was asked before but there was no reply to it. > I would appreciate any suggestion any of you might have. I am > interested in plotting several "implicit functions" (F(x,y,z)=0) on > the same fig. Is there anyone who has an

[R] Question about regression without an intercept

2008-12-27 Thread Ajay Shah
Consider this code fragment: --- set.seed(42) x <- runif(20) y <- 2 + 3*x + rnorm(20) m1 <- lm(y ~ x) m2 <- lm(y ~ -1 + x) summary(m1) summary(m2) cor(y, fitted.values(m1))^2 cor(y, fitted.values(m2))^2

Re: [R] Percent damage distribution

2008-12-27 Thread diegol
Thank you, Ben. The beta distribution seems flexible enough. I knew this distribution but had never seen it in this kind of application, and somehow did not recall it. rbeta(n, shape1 = 5, shape2 = 1) looks reasonable to start with for my simple task. If I had a real dataset I could parameterize

[R] Zipf fitting using R

2008-12-27 Thread Epithemeus
Dear R-users, I am new to R and would like to use it for fitting the zipf distribution to some numeric data that I have. Here's the snippet that I use: library(VGAM) X <- read.table(file("~\\mydata.txt", encoding="latin1")) w <- as.vector(t((X[2]))) w <- w/sum(w) y <- (1:length(w)) fit

Re: [R] Internal Memory Limit in R

2008-12-27 Thread Prof Brian Ripley
Once again you are asking questions that the help system can tell you the answer to. Try help.search("memory limit") and also learn about RSiteSearch. On Sat, 27 Dec 2008, Gundala Viswanath wrote: Hi all, What's the limit of memory size that can be handled by R? The reason I ask this is b

[R] contour plot - smooth lines

2008-12-27 Thread tommaso . letterio
Dear R-Users, I am using 'contour' to plot a graph using values x,y and a matrix z. I would like to obtain 'smooth lines' instead of no-smooth contour lines. I tried with filled.contour too. In a Post I found yy <-predict(interpSpline(x, y)) I could use that method for each range that I want to pl

[R] Internal Memory Limit in R

2008-12-27 Thread Gundala Viswanath
Hi all, What's the limit of memory size that can be handled by R? The reason I ask this is because I want to perform tag counts using 'table' function. And there are around 4~5GB of such tags to be counted. I wonder if R can handle such large datasets. - Gundala Viswanath Jakarta - Indonesia _