Re: [R] documentation in R

2011-06-12 Thread nuncio m
Dear Arun, Prof. Rob Hyndman's forecast package has automated arima. You have to install 'forecast' library for that. in linux go to r-prompt and type install.packages(). Hope this helps nuncio On Mon, Jun 13, 2011 at 12:10 PM, siddharth arun wrote: > How we can call auto.arima in

[R] documentation in R

2011-06-12 Thread siddharth arun
How we can call auto.arima in R. Is there any cran package we need to install for this function? -- Siddharth Arun, 4th Year Undergraduate student Industrial Engineering and Management, IIT Kharagpur [[alternative HTML version deleted]] __ R-h

Re: [R] running R commands asynchronously

2011-06-12 Thread Norm Matloff
On 06/10/2011 02:29 PM, Richard M. Heiberger wrote: > I am interested in running R commands asynchronously... You can do this with my Rdsm package on CRAN. Set up 2 Rdsm clients, which I'll call A and B. Use client A as you main R session, where you do most of your work, but start your asynchro

Re: [R] R graphs differ from exported one

2011-06-12 Thread Mark Seeto
I didn't include code because I wasn't asking for help; I was merely commenting that I had seen the same thing happen. But thank you for mentioning dev.off, which I had not heard of before. On Mon, Jun 13, 2011 at 3:55 PM, Prof Brian Ripley wrote: > Usually this happens when you forget to run de

Re: [R] R graphs differ from exported one

2011-06-12 Thread Prof Brian Ripley
Usually this happens when you forget to run dev.off(), as in that example. But we don't have the commented, minimal, self-contained, reproducible code. the posting guide and the footer of every R message asks for. On Sun, 12 Jun 2011, Mark Seeto wrote: Raptorista wrote: Now, the graph

Re: [R] computer name

2011-06-12 Thread David Scott
On 13/06/11 15:19, pdb wrote: Is there an r function that will be able to identify the computer the code is running on? I have some common code that I run on several computers and each has a database with a different server name - although the content is identical. I need to set thisServer dep

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Hi Weidong, thank you very much. It really works fine. Robert 2011/6/12 Weidong Gu : > this may work. > X<-data.frame(sapply(X,function(x) as.factor(x))) > reg3=lm(Y~.,data=X) > dummy.coef(reg3) > > Weidong Gu > > On Sun, Jun 12, 2011 at 4:55 PM, Robert Ruser wrote: >> Hi, >> but I want to get t

Re: [R] computer name

2011-06-12 Thread Thomas Levine
Not exactly R, but how about > pcname <- system('uname -n',intern=T) Tom On Sun, Jun 12, 2011 at 11:19 PM, pdb wrote: > > Is there an r function that will be able to identify the computer the code is > running on? > > I have some common code that I run on several computers and each has a > data

Re: [R] R graphs differ from exported one

2011-06-12 Thread Mark Seeto
Raptorista wrote: > > Now, the graph that appears is very nice: indeed it has a title, two > axes with their labels and all the rest; > but when I give commands > > postscript(file="plot.eps", onefile=FALSE) > qqnorm (col) > > to save the graph to a file "plot.eps" to include it in a TeX, the f

Re: [R] automatically generate the output name of my "for" loops

2011-06-12 Thread B77S
?paste something like... paste (group, i, sep="_") jiliguala wrote: > > Hello R users, > > I am new to R and am having difficulty with the output name of my "for" > loops. > > here is the problem: > > > for (i in c(1:100)) > { > the name of the groups <- which(k1$cluster==i) > } > > how

Re: [R] automatically generate the output name of my "for" loops

2011-06-12 Thread B77S
?paste something like... paste ("group", i, sep="_") jiliguala wrote: > > Hello R users, > > I am new to R and am having difficulty with the output name of my "for" > loops. > > here is the problem: > > > for (i in c(1:100)) > { > the name of the groups <- which(k1$cluster==i) > } > > ho

[R] computer name

2011-06-12 Thread pdb
Is there an r function that will be able to identify the computer the code is running on? I have some common code that I run on several computers and each has a database with a different server name - although the content is identical. I need to set thisServer depending on which machine the code

[R] Somers Dyx

2011-06-12 Thread Tyler Rinker
Hello R Community, I'm continuing to work through logistic regression (thanks for all the help on score test) and have come up against a new opposition. I'm trying to compute Somers Dyx as some suggest this is the preferred method to Somers Dxy (Demaris, 1992). I have searchered the [R] arc

Re: [R] Side by side scatter plots with specified regression lines

2011-06-12 Thread William Revelle
Dear Sigrid, At 12:46 PM -0700 6/12/11, Sigrid wrote: I am new and self taught in R, so please bear with me. I want to create two scatter plots side by side. The data set includes measurements from two different countries with 7 treatments over a timeline (x-axis). Problem 1 I want to have eac

Re: [R] NLS fit for exponential distribution

2011-06-12 Thread Diviya Smith
Thank you for very informative answers. This is great help. Peter, thanks for correcting the model. That was exactly what I meant - apologies for the typo. I was able to run the analysis on some simulated data and the subset of data that I had posted earlier. However, when I apply the analysis to

Re: [R] Pointers in R

2011-06-12 Thread Jeff Newmiller
Lists are recursive and heterogenous in R. Just assign the values to elements in lists and assign those lists to elements in other lists to build your tree. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#

Re: [R] Sorting Dataframes

2011-06-12 Thread SamiC
Thanks very much. I did it using the do.call and compared it to my loop method and the results were exactly the same. In future i think i will use this function - a lot less typing and time consuming! -- View this message in context: http://r.789695.n4.nabble.com/Sorting-Dataframes-tp3580075p

Re: [R] NLS fit for exponential distribution

2011-06-12 Thread Dennis Murphy
Hi: If you use RStudio, then you can use its manipulate package to figure out starting values for the model visually through sliders. Walmes Zeviani posted the template of how to do this last week; I've just adapted it for the models under consideration. It's interesting to play with this because

Re: [R] Linear model - coefficients

2011-06-12 Thread Weidong Gu
this may work. X<-data.frame(sapply(X,function(x) as.factor(x))) reg3=lm(Y~.,data=X) dummy.coef(reg3) Weidong Gu On Sun, Jun 12, 2011 at 4:55 PM, Robert Ruser wrote: > Hi, > but I want to get the coefficients for every variables from x1 to x5. > (x1 was an example) > > Robert > > 2011/6/12 Jorge

Re: [R] Running a GMM Estimation on dynamic Panel Model using plm-Package

2011-06-12 Thread Jan Schulz
Hi! Am 12.06.2011 21:43, schrieb bstudent: Error in solve.default(Reduce("+", A2)) : System ist für den Rechner singulär: reziproke Konditionszahl = 4.08048e-22 Error in solve.default(Reduce("+", A2)) : System is singulary for the computer: reciprocal number of conditions = 4.08048e-22

[R] Pointers in R

2011-06-12 Thread Jaimin Dave
Hello Everyone, I am new to R and would like to create a quad tree in R. However the problem is that I don't think R has pointers. Is there any way to create a tree in R? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org maili

Re: [R] NLS fit for exponential distribution

2011-06-12 Thread Achim Zeileis
On Sun, 12 Jun 2011, peter dalgaard wrote: On Jun 12, 2011, at 18:57 , Diviya Smith wrote: Hello there, I am trying to fit an exponential fit using Least squares to some data. #data x <- c(1 ,10, 20, 30, 40, 50, 60, 70, 80, 90, 100) y <- c(0.033823, 0.014779, 0.004698, 0.001584,

Re: [R] NLS fit for exponential distribution

2011-06-12 Thread peter dalgaard
On Jun 12, 2011, at 18:57 , Diviya Smith wrote: > Hello there, > > I am trying to fit an exponential fit using Least squares to some data. > > #data > x <- c(1 ,10, 20, 30, 40, 50, 60, 70, 80, 90, 100) > y <- c(0.033823, 0.014779, 0.004698, 0.001584, -0.002017, -0.003436, > -0.06

Re: [R] Likelihood ratio test

2011-06-12 Thread Achim Zeileis
On Sun, 12 Jun 2011, Jorge Ivan Velez wrote: Hi Diviya, Take a look at the lrtest function in the lmtest package: install.packages('lmtest) require(lmtest) ?lrtest Yes, when you have to nls() fits, say m1 and m2, you can do lrtest(m1, m2) However, I don't think that both m1 and m2 can be i

Re: [R] Error in NLS example in the documentation

2011-06-12 Thread peter dalgaard
On Jun 12, 2011, at 20:25 , Diviya Smith wrote: > Hello there, > > I am trying to use R function NLS to analyze my data and one of the examples > in the documentation is - > > ## the nls() internal cheap guess for starting values can be sufficient: > > x <- -(1:100)/10 > y <- 100 + 10 * exp(x

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Hi, but I want to get the coefficients for every variables from x1 to x5. (x1 was an example) Robert 2011/6/12 Jorge Ivan Velez : > Hi Robert, > > Try this: > reg2 <- lm( Y ~ factor(x1) + factor(x2) + factor(x3) + factor(x4) + > factor(x5) - 1, data = X  ) > cof(ref2) > HTH, > Jorge > > On Sun, J

Re: [R] R graphs differ from exported one

2011-06-12 Thread Joshua Wiley
Hmm, did you shut the device down afterward (i.e., call dev.off() )? I do not have any logic why that would induce the behavior you say you are getting, but this works just fine for me: postscript("tmp.eps", onefile = TRUE) qqnorm(rnorm(20)) dev.off() and creates the attached file (possibly not a

Re: [R] Linear model - coefficients

2011-06-12 Thread Jorge Ivan Velez
Hi Robert, Try this: reg2 <- lm( Y ~ factor(x1) + factor(x2) + factor(x3) + factor(x4) + factor(x5) - 1, data = X ) cof(ref2) HTH, Jorge On Sun, Jun 12, 2011 at 4:40 PM, Robert Ruser <> wrote: > Prof. Ripley, thank you very much for the answer but wanted to get > something else. There is an

Re: [R] add a curve that fits the highest values on the plot.

2011-06-12 Thread Joshua Wiley
Hi Nanami, I am not sure exactly what you mean by "fits the peaks"...are any of these plots what you want? x <- 1:20 y <- c(19.4, 17.9, 8.1, 11.3, 7.8, 8, 5, 1.7, 3.9, 5.4, 7.5, 5.4, 4.7, 5, 4.9, 3.5, 2.9, 2.4, 1.4, 1.7) ## Find peaks index <- which(c(NA, diff(sign(diff(y == -2) dev.new() la

Re: [R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Prof. Ripley, thank you very much for the answer but wanted to get something else. There is an example and an explanation: options(contrasts=c("contr.sum","contr.poly")) # contr.sum uses ‘sum to zero contrasts’ Y <- c(6,3,5,2,3,1,1,6,6,6,7,4,1,6,6,6,6,1) X <- structure(list(x1 = c(2L, 3L, 1L, 3L,

[R] Side by side scatter plots with specified regression lines

2011-06-12 Thread Sigrid
I am new and self taught in R, so please bear with me. I want to create two scatter plots side by side. The data set includes measurements from two different countries with 7 treatments over a timeline (x-axis). Problem 1 I want to have each plot to include the data from one of the countries wit

Re: [R] Likelihood ratio test

2011-06-12 Thread Jorge Ivan Velez
Hi Diviya, Take a look at the lrtest function in the lmtest package: install.packages('lmtest) require(lmtest) ?lrtest HTH, Jorge On Sun, Jun 12, 2011 at 1:16 PM, Diviya Smith <> wrote: > Hello there, > > I want to perform a likelihood ratio test to check if a single exponential > or a sum of

[R] Running a GMM Estimation on dynamic Panel Model using plm-Package

2011-06-12 Thread bstudent
Hello, although I searched for a solution related to my problem I didn´t find one, yet. My skills in R aren´t very large, however. For my Diploma thesis I need to run a GMM estimation on a dynamic panel model using the "pgmm" - function in the plm-Package. The model I want to estimate is: "Y(t) =

[R] plotnetwork {spaa} : how to get an absolute interval (i.e. not based on the range of input data) ?

2011-06-12 Thread max ofiatpolski
I'm using plotnetwork {spaa} in order to get a correlation network plot of my data (e.g.: http://www.oga-lab.net/RGM2/func.php?rd_id=spaa:plotnetwork). By default, 'interval' argument indicate the number of intervals by which the range of input data is partitioned (the number of partitions betw

[R] Error in NLS example in the documentation

2011-06-12 Thread Diviya Smith
Hello there, I am trying to use R function NLS to analyze my data and one of the examples in the documentation is - ## the nls() internal cheap guess for starting values can be sufficient: x <- -(1:100)/10 y <- 100 + 10 * exp(x / 2) + rnorm(x)/10 nlmod <- nls(y ~ Const + A * exp(B * x), trace=T

[R] Likelihood ratio test

2011-06-12 Thread Diviya Smith
Hello there, I want to perform a likelihood ratio test to check if a single exponential or a sum of 2 exponentials provides the best fit to my data. I am new to R programming and I am not sure if there is a direct function for doing this and whats the best way to go about it? #data x <- c(1 ,10,

[R] R graphs differ from exported one

2011-06-12 Thread Massimiliano
Hello everybody! This is my first mail so I'll write a couple of lines of self-introduction. My name is Massimiliano, I'm from Italy and I'm studying Mathematical Engineering. I started using R in my Statistics course and have to use it to make a project which I'll discuss at the end of the course.

[R] NLS fit for exponential distribution

2011-06-12 Thread Diviya Smith
Hello there, I am trying to fit an exponential fit using Least squares to some data. #data x <- c(1 ,10, 20, 30, 40, 50, 60, 70, 80, 90, 100) y <- c(0.033823, 0.014779, 0.004698, 0.001584, -0.002017, -0.003436, -0.06, -0.004626, -0.004626, -0.004626, -0.004626) sub <- data.frame(x

[R] automatically generate the output name of my "for" loops

2011-06-12 Thread jiliguala
Hello R users, I am new to R and am having difficulty with the output name of my "for" loops. here is the problem: for (i in c(1:100)) { the name of the groups <- which(k1$cluster==i) } how can it automatically generate the name for 100 cluster? what should i put in the bold letter place.

[R] statistical model with censored independent variable

2011-06-12 Thread xin wei
hello: Does anyone know any R function which handles statisitcal model when the independent variable is censored? I know survival package does the analysis for censored dependnent variable. thanks -- View this message in context: http://r.789695.n4.nabble.com/statistical-model-with-censored-inde

[R] plot probabilities of occurrence of values in a vector using connected points

2011-06-12 Thread Andra Tolbus
Hi all, I have been struggling with some plotting issues (maybe not that difficult but I am stuck). If I have 2 vectors : 1st with average values of the columns of a data frame, which, looks similar to : v: (1.4,3,3,3,4.5,0,0,0,0,0,0,0,25.5,6,6,4.2) 2nd with t

[R] add a curve that fits the highest values on the plot.

2011-06-12 Thread ads pit
Hi everyone, I am given two vectors - for example - x= c(0:20) > x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 and > y [1] 19.4 17.9 8.1 11.3 7.8 8.0 5.0 1.7 3.9 5.4 7.5 5.4 4.7 5.0 4.9 [16] 3.5 2.9 2.4 1.4 1.7 > plot(x,y,xlim=range(x),ylim=range(y))

Re: [R] Linear model - coefficients

2011-06-12 Thread Prof Brian Ripley
?dummy.coef (NB: 'R' does as you tell it, and if you ask for the default contrasts you get coefficients a2 and a3, not a1 and a2. So perhaps you did something else and failed to tell us? And see the comment in ?dummy.coef about treatment contrasts.) On Sun, 12 Jun 2011, Robert Ruser wrote

Re: [R] snow package

2011-06-12 Thread Unger, Kristian, Dr.
Prof Ripley Thanks for your message - you are absolutely right. I should have provided more information. Meanwhile, I found out that loading an R workspace prevented parApply from working properly. The workspace contains many objects and I could not figure out which one was responsible for causin

[R] Linear model - coefficients

2011-06-12 Thread Robert Ruser
Dear R Users, Using lm() function with categorical variable R use contrasts. Let assume that I have one X independent variable with 3-levels. Because R estimate only 2 parameters ( e.g. a1, a2) the coef function returns only 2 estimators. Is there any function or trick to get another a3 values. I

Re: [R] Reshape:cast; error using "..." in formula expression.

2011-06-12 Thread Hadley Wickham
Yes, the basic problem is that you forgot to melt the data before trying to cast it. Hadley On Thursday, June 9, 2011, misterbray wrote: > Dennis, doing some more research, and it seems you actually can include the > ... term directly in the formula: cf. page 8 of > http://www.had.co.nz/reshape/

Re: [R] snow package

2011-06-12 Thread Prof Brian Ripley
On Sun, 12 Jun 2011, Unger, Kristian, Dr. wrote: Hi I try parallelising some code using the snow package and the following lines: cl <- makeSOCKcluster(8) pfunc <- function (x) (if(x <= (-th)) 1 else 0) ###correlation coefficient clusterExport(cl,c("pfunc","th")) cor.c.f <- parApply(cl,tms,c(

Re: [R] using categorical variable in multiple regression

2011-06-12 Thread Weidong Gu
for categorical independent variables, regression models in R will generate dummy indicators based on your setting of contrasts (default contr.treatment). Use model.matrix(your model) to see how R does this internally. Weidong Gu On Sun, Jun 12, 2011 at 2:38 AM, setlist wrote: > Hello, I wanted

Re: [R] Divide matrix into multiple smaller matrices

2011-06-12 Thread mdvaan
Hi, I still haven't found a solution for this problem. Is there a way in which I can slice the objects in c based on the info in h? Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Divide-matrix-into-multiple-smaller-matrices-tp3552399p3591868.html Sent from the R hel

Re: [R] rcspline.plot query

2011-06-12 Thread Frank Harrell
Please see my previous note and please read the documentation. Also note the difference between a character string literal in quotes and the name of a vector, which is usually not quoted. Frank Chalikias George wrote: > > The actual dataframe that I have imported on R is > >Death adp > 1

[R] snow package

2011-06-12 Thread Unger, Kristian, Dr.
Hi I try parallelising some code using the snow package and the following lines: cl <- makeSOCKcluster(8) pfunc <- function (x) (if(x <= (-th)) 1 else 0) ###correlation coefficient clusterExport(cl,c("pfunc","th")) cor.c.f <- parApply(cl,tms,c(1,2),FUN=pfunc) The parApply results in the error m

Re: [R] welch anova and post-hoc

2011-06-12 Thread peter dalgaard
On Jun 12, 2011, at 12:50 , eldor ado wrote: > dear r community... > > it loks like i won't be able to reach homogenity of variance for my > dataset, so i end up with welch anova instead of regular anova. > documentation on this test is rather scarce, so maybe someone here can > enlighten me a b

Re: [R] partial correlation

2011-06-12 Thread Sarah Goslee
A good start might be to go to http://rseek.org and search for partial correlation to get information on the packages and functions that offer it. >From there, if you have specific questions, describing your data, what you've tried, what results you've gotten, and what results you expect would be

[R] welch anova and post-hoc

2011-06-12 Thread eldor ado
dear r community... it loks like i won't be able to reach homogenity of variance for my dataset, so i end up with welch anova instead of regular anova. documentation on this test is rather scarce, so maybe someone here can enlighten me a bit: - do i understand that no two-way implementation of th

[R] partial correlation

2011-06-12 Thread setlist
how can I compute partial correlation there's four variables; income, age, educational level, race. income is indenpendent variable and race is nominal variable I want to calculate partial correlation or semi-partial correlation between income & race help me out... thanks. -- View this messag

[R] using categorical variable in multiple regression

2011-06-12 Thread setlist
Hello, I wanted to do the multiple regression on categorical predictor data there's variable x1,x2,x3 and x3 is categorical one. so i just used as.factor(x3) and then ran multiple regression is it a good way to do the multiple regression on categorical predictor data? and how can I interpret the es

Re: [R] rcspline.plot query

2011-06-12 Thread Chalikias George
The actual dataframe that I have imported on R is Death adp 1 0 58.00 2 1 18.70 3 0 21.75 4 1 25.35 5 0 20.55 6 1 28.05 7 0 50.15 8 1 31.25 9 1 32.75 10 1 28.95 11 1 15.10 12 0 45.05 13 1 19.95 14 0 32.95 15 0 22.60 16 0

[R] logistic regression where the independant variable is a ratio

2011-06-12 Thread Patrick Giraudoux
Dear Lister, I have collected data in 6 geographical areas on prevalence of a parasite in humans and in foxes. The results are expressed as a number of positive or negative cases in human and foxes in the following data.frame: Pvtab <- structure(list(posHum = c(3, 5, 3, 17, 0, 4), negHum = c

Re: [R] Test if data uniformly distributed (newbie)

2011-06-12 Thread Petr Savicky
On Fri, Jun 10, 2011 at 10:15:36PM +0200, Kairavi Bhakta wrote: > Thanks for your answer. The reason I want the data to be uniform: It's the > first step in a machine learning project I am working on. If I know the data > isn't uniformly distributed, then this means there is probably something > wr

Re: [R] How to compute the P-value for a mixture of chi^2 distributions

2011-06-12 Thread peter dalgaard
On Jun 12, 2011, at 03:36 , Thomas Lumley wrote: > On Sun, Jun 12, 2011 at 12:44 PM, Tiago Pereira > wrote: > >> The test I am working on has an asymptotic 0.5*chi2(1)+0.5*chi2(2) >> distribution, where numbers inside parenthesis stand for the degrees of >> freedom. Is is possible to compute qu

Re: [R] How to compute the P-value for a mixture of chi^2 distri

2011-06-12 Thread Ted Harding
On 12-Jun-11 01:36:00, Thomas Lumley wrote: > On Sun, Jun 12, 2011 at 12:44 PM, Tiago Pereira > wrote: > >> The test I am working on has an asymptotic 0.5*chi2(1)+0.5*chi2(2) >> distribution, where numbers inside parenthesis stand for the >> degrees of freedom. Is is possible to compute quickly i

Re: [R] Score Test Function

2011-06-12 Thread peter dalgaard
On Jun 12, 2011, at 07:54 , wrote: > The score test looks at the effect of adding extra columns to the model > matrix. The function glm.scoretest takes the fitted model object as the > first argument and the extra column, or columns, as the second argument. > Your x2 argument has length o