Re: [R] Factors and Multinomial Logistic Regression

2013-05-02 Thread Lorenzo Isella
On Thu, 02 May 2013 22:04:26 +0200, peter dalgaard wrote: On May 2, 2013, at 20:33 , Lorenzo Isella wrote: On Wed, 01 May 2013 23:49:07 +0200, peter dalgaard wrote: It still doesn't work! Apologies; since I had already imported nnet in my workspace, the script worked on my m

[R] Likelihood

2013-05-02 Thread Preetam Pal
Hi all, I have run a regression and want to calculate the likelihood of obtaining the sample. Is there a way in which I can use R to get this likelihood value? Appreciate your help on this. The following are the details: raw_ols1=lm(data$LOSS~data$GDP+data$HPI+data$UE) summary(raw_ols1) Call

Re: [R] Create and read symbolic links in Windows

2013-05-02 Thread Prof Brian Ripley
On 03/05/2013 07:33, Santosh wrote: Thanks for the suggestions. In windows (Windows 7, 64-bit), I couldn't get "file.symlink" to work, but "file.link" did return the result to be "TRUE" but at the target location, I did not see any link. Not sure I am missing anything more.. Hope it's nothing to

Re: [R] Create and read symbolic links in Windows

2013-05-02 Thread Santosh
Thanks for the suggestions. In windows (Windows 7, 64-bit), I couldn't get "file.symlink" to work, but "file.link" did return the result to be "TRUE" but at the target location, I did not see any link. Not sure I am missing anything more.. Hope it's nothing to do with administrator accounts and ad

Re: [R] Problems with reading data by readWorksheetFromFile of XLConnect Package

2013-05-02 Thread jpm miao
Hi Anthony, Thank you very much. It works very well. However, after this line > temp <- sapply( temp , as.numeric ) the data becomes a series of numbers instead of a matrix. Is there any way to keep it a matrix? Thanks, Miao > temp<-readWorksheetFromFile("130502temp.xlsx", sheet=1

Re: [R] Self-developed package -- installation

2013-05-02 Thread PIKAL Petr
Hi Probably others can give you some better insight but copying folder with package from one machine to another is possible until the installation is required by a new version of R (about each 3 years). Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounc

Re: [R] ODE solver

2013-05-02 Thread Thomas Petzoldt
Hi, just press ESC and the solver should stop. BTW, warnings like this are usually a sign of unrealistic parameters, problematic model equations or inappropriate tolerance settings. See also: http://cran.r-project.org/web/packages/deSolve/vignettes/deSolve.pdf#46 ThPe On 5/2/2013 10:36 AM,

[R] (no subject)

2013-05-02 Thread T P Kharel
I have posted a R copula question yesterday but it is not accepted yet. How long does it take? I am waiting if some one can help me on my Copula package related question. Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailin

[R] Calculating distance matrix for large dataset

2013-05-02 Thread HJ YAN
Dear R users I wondered if any of you ever tried to calculate distance matrix with very large data set, and if anyone out there can confirm this error message I got actually mean that my data is too large for this task. negative length vectors are not allowed My data size and code used dim(m

Re: [R] Size of a refClass instance

2013-05-02 Thread Martin Morgan
On 05/01/2013 11:20 AM, David Kulp wrote: I'm using refClass for a complex multi-directional tree structure with possibly 100,000s of nodes. The refClass design is very impressive and I'd love to use it, but I've found that the size of refClass instances are very large and creation time is slow.

Re: [R] Factors and Multinomial Logistic Regression

2013-05-02 Thread peter dalgaard
On May 2, 2013, at 20:33 , Lorenzo Isella wrote: > On Wed, 01 May 2013 23:49:07 +0200, peter dalgaard wrote: > >> It still doesn't work! >> > > > Apologies; since I had already imported nnet in my workspace, the script > worked on my machine even without importing it explicitly (see the

Re: [R] Package survey: singularities in linear regression models

2013-05-02 Thread Thomas Lumley
On Fri, May 3, 2013 at 2:27 AM, Sebastian Weirich < sebastian.weir...@iqb.hu-berlin.de> wrote: > Hello, > > I want to specify a linear regression model in which the metric outcome is > predicted by two factors and their interaction. glm() computes effects for > each factor level and the levels of

Re: [R] Multiple Paired T test from large Data Set with multiple pairs

2013-05-02 Thread arun
If you have Sites with "ALA1", "ALA2", etc it would be better to do: lst1<- split(WrackMass,substr(WrackMass$Site.X.Treatment,1,4))  res1<-lapply(lst1,function(x) do.call(cbind,lapply(x[,1:4],function(y) {Site<- gsub(".*\\d(.*)","\\1",x$Site.X.Treatment);t.test(y[Site=="A"],y[Site=="U"],pair

Re: [R] Multiple Paired T test from large Data Set with multiple pairs

2013-05-02 Thread arun
Hi, Still no data. >From your code, it looks like data is similar to this: set.seed(25) WrackMass<- data.frame(Algae.Mass=sample(40:50,30,replace=TRUE),Seagrass.Mass=sample(30:70,30,replace=TRUE),Terrestrial.Mass=sample(80:100,30,replace=TRUE),Other.Mass=sample(40:60,30,replace=TRUE),Site.X.Tre

Re: [R] Create and read symbolic links in Windows

2013-05-02 Thread Prof Brian Ripley
On 02/05/2013 19:50, Santosh wrote: Dear Rxperts.. Got a couple of quick q's.. I am using R in windows environment (both 32-bit and 64-bit) a) Is there a way to create symbolic links to some data files? See ?file.symlink. ??'symbolic link' should have got you there. Note that this is not very

[R] Create and read symbolic links in Windows

2013-05-02 Thread Santosh
Dear Rxperts.. Got a couple of quick q's.. I am using R in windows environment (both 32-bit and 64-bit) a) Is there a way to create symbolic links to some data files? b) How do I read data from symbolic links? Thanks so much.. Santosh [[alternative HTML version deleted]]

Re: [R] How to "call" an object given a string?

2013-05-02 Thread Greg Snow
This is FAQ 7.21 The most important part of that answer is the last few lines where it says in effect "Don't Do This" and shows the basics of using a list instead. On Mon, Apr 29, 2013 at 5:07 AM, Rui Esteves wrote: > Hello, > > This is very basic and very frustrating. > > Suppose this: > >A=5

Re: [R] Multiple Paired T test from large Data Set with multiple pairs

2013-05-02 Thread arun
My code was based on the assumption that your dataset was similar to the one I provided.  Please provide an example dataset (use dput(head(dataset),20)) http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example A.K. >Arun, > >I have tried applying your suggestions t

Re: [R] Self-developed package -- installation

2013-05-02 Thread Duncan Murdoch
On 02/05/2013 12:54 PM, Hui Du wrote: Hi All, I have a question about package installation in R. We have developed a package, say 'ABC'. We have installed it in two machines, A and B by running 'Install Package(s) from local zip file'. Everything was fine. Right now, suppose that package got

[R] Self-developed package -- installation

2013-05-02 Thread Hui Du
Hi All, I have a question about package installation in R. We have developed a package, say 'ABC'. We have installed it in two machines, A and B by running 'Install Package(s) from local zip file'. Everything was fine. Right now, suppose that package got damaged in machine A and our zipped file

Re: [R] Adding Column to Data Frames Using a Loop

2013-05-02 Thread MacQueen, Don
I'm a little puzzled, because you're asking for something simpler than for(i in letters[24:26] ) assign( i, myfunc(get(i))) and suggesting things along the lines of assign(paste(i,"$V4",sep=""),paste(get(i),"$V2+",get(i),"$V3",sep="")) To me, the former is much simpler, much easier to read and

[R] Package survey: singularities in linear regression models

2013-05-02 Thread Sebastian Weirich
Hello, I want to specify a linear regression model in which the metric outcome is predicted by two factors and their interaction. glm() computes effects for each factor level and the levels of the interaction. In the case of singularities glm() displays "NA" for the corresponding coefficients

[R] Questions regarding use of predict() with glmpath

2013-05-02 Thread Stijn de Vos
I'm trying to do LASSO in R with the package glmpath. However, I'm not sure if I am using the accompanying prediction function *predict.glmpath()* correctly. Suppose I fit some regularized binomial regression model like so: library(glmpath);load(heart.data);attach(heart.data); fit <- glmpath(x,

[R] Vector allocation problem while trying to plot 6 MB data file

2013-05-02 Thread Ramon Hofer
Hi all I'm trying to analyse the network speed and used iperf to create a csv file containing the link test data. It's only about 6 MB big but contains about 40'000 samples. I can do boxplots (apart from printing the number of samples but I ask separately for that). To find the behaviour over ti

Re: [R] multivariate, hierarchical model

2013-05-02 Thread Omnia Abdulrazeg
in addition, I get this error whenever I want to plot the predicted values plot(augPred(mod2))Error in sprintf(gettext(fmt, domain = domain), ...) : invalid type of argument[1]: 'symbol' From: om...@hotmail.com To: r-help@r-project.org Subject: [R] multivariate, hierarchical model Date: Thu, 2

Re: [R] ARMA with other regressor variables

2013-05-02 Thread Nilesh Gupta
Check the package rugarch. It is capable of doing ARMA calculations with external regressors The woods are lovely, dark and deep But I have promises to keep And miles to go before I sleep And miles to go before I sleep - On Thu, May 2, 2013 at 3:45 PM, Preetam Pal wrote: > Hi, > > I want t

[R] How does dsgh do the standardization?

2013-05-02 Thread Stat Tistician
Hi, I try to understand how the generalized hyperbolic distribution is standardized. One reference is the rugarch vignette, page 16-18: http://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf I looked at the code of the dsgh function in the fBasics package:

[R] multivariate, hierarchical model

2013-05-02 Thread Omnia Abdulrazeg
Sorry for the last email, sent too early. I have a small data set that has a hierarchical structure. It has both temporal (year, months) and spatial (treatment code and zone code). The following explains the data: WSZ_Code the water supply zone code (1 to 8) Tr

Re: [R] help understanding hierarchical clustering

2013-05-02 Thread David Carlson
That clears up a great deal. Each row of your data represents the observation of a particular species on a particular image. You are actually clustering localities (images) and you want to know what species are commonly found in localities with similar temp/sal/depth/subs. Your current approach i

Re: [R] R issue with unequal large data frames with multiple columns

2013-05-02 Thread Adeel - SafeGreenCapital
Thank you Arun (and everyone else)-- this is in the right the direction. I"ll post the code that worked shortly for everyone else in case you were curious. -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Thursday, May 02, 2013 7:09 AM To: Adeel Amin Cc: R help Subject:

Re: [R] ODE solver

2013-05-02 Thread William Dunlap
Using options(warn=2) is the easiest way to get this function to stop when it makes the warning, but it will stop at any warning, not just the one you are worried about. You can use withCallingHandlers() or tryCatch() to be more selective. E.g., the following will stop on any warning that has "ti

Re: [R] ODE solver

2013-05-02 Thread David Winsemius
On May 2, 2013, at 1:36 AM, Tjun Kiat Teo wrote: > I am trying to use the package ode and periodically it will come up with > this error message > > Warning..Internal T (=R1) and H (=R2) are > such that in the machine, T + H = T on the next step > (H = step size). Solver will continue anyway. >

Re: [R] R issue with unequal large data frames with multiple columns

2013-05-02 Thread arun
Hi,May be this helps: dat1<-structure(list(X.DATE = c("01052007", "01072007", "01072007", "02182007", "02182007", "02242007", "03252007"), X.TIME = c("0230", "0330", "0440", "0440", "0440", "0330", "0230"), VALUE = c(37, 42, 45, 45, 45, 42, 45), VALUE2 = c(29, 24, 28, 27, 35, 32, 32 )), .Names

Re: [R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0

2013-05-02 Thread Katherine Gobin
Dear Sir, Thanks a lot. The "1 in 'RQuantLib_0.3.10(1)", I understand was appearing because I had saved RQuantLib number of times in my local directory and each time it renamed the installation file with no added to it. Thanks again. Now I am able to install the package along-with Rcpp. Rega

Re: [R] function gstat r with pyhton

2013-05-02 Thread Pascal Oettli
Hi, As you probably noticed, it is r-help list, not python-help list. Regards, Pascal On 05/02/2013 09:38 PM, Enzo Cocca wrote: hi, can someone help me to put this code R in python ? library(gstat) VGM_PARAM_A3 <- gstat(id="bos_bison", formula=combusto~1,locations=~coord_x+coord_y, data=ar

[R] function gstat r with pyhton

2013-05-02 Thread Enzo Cocca
hi, can someone help me to put this code R in python ? library(gstat) VGM_PARAM_A3 <- gstat(id="bos_bison", formula=combusto~1,locations=~coord_x+coord_y, data=archezoology_table, nmax = 10) VGM_PARAM_A3 <- gstat(VGM_PARAM_A3, "calcinati", strie~1, locations=~coord_x+coord_y, archezoology_table

Re: [R] Divide matrix columns by different numbers

2013-05-02 Thread arun
  t(t(k)/div) # [,1] [,2] #[1,]    1  2.0 #[2,]    2  2.5 #[3,]    3  3.0 A.K. - Original Message - From: Sachinthaka Abeywardana To: "r-help@r-project.org" Cc: Sent: Thursday, May 2, 2013 2:28 AM Subject: [R] Divide matrix columns by different numbers Hi all, I have a feeling t

Re: [R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0

2013-05-02 Thread Prof Brian Ripley
On 02/05/2013 13:09, Katherine Gobin wrote: Dear Forum, I have R version 3.0.0 installed and need to install RQuantLib pacakge. I tried to install it from CRAN Mirror and I couldn't load it. I had saved the package i zip format and tried to install it locally but I am getting following error.

[R] Clean Price of Bond : Can't install "RQuantLib" in R version 3.0.0

2013-05-02 Thread Katherine Gobin
Dear Forum, I have R version 3.0.0 installed and need to install RQuantLib pacakge. I tried to install it from CRAN Mirror and I couldn't load it. I had saved the package i zip format and tried to install it locally but I am getting following error. > utils:::menuInstallLocal() Error in read.d

Re: [R] warnings in ARMA with other regressor variables

2013-05-02 Thread Jose Iparraguirre
Preetam, Have a look at this post: http://stats.stackexchange.com/questions/26999/auto-arima-warns-nans-produced-on-std-error José -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Preetam Pal Sent: 02 May 2013 12:24 To: r-help@r-pr

[R] warnings in ARMA with other regressor variables

2013-05-02 Thread Preetam Pal
Hi all, I want to fit the following model to my data: Y_t= a+bY_(t-1)+cY_(t-2) + Z_t +Z_(t-1) + Z_(t-2) + X_t + M_t i.e. it is an ARMA(2,2) with some additional regressors X and M. [Z_t's are the white noise variables] So, I run the following code: for (i in 1:rep) {index=s

Re: [R] ARMA with other regressor variables

2013-05-02 Thread Jose Iparraguirre
Dear Preetam, I suggest that you read the TSA package documentation (and, if possible, the book by Cryer and Chan (Time Series Analysis with Applications in R) -it contains the function arimax which fits ARIMA models with exogenous variables. One thing: once you run your model, you will get the

[R] ARMA with other regressor variables

2013-05-02 Thread Preetam Pal
Hi, I want to fit the following model to my data: Y_t= a+bY_(t-1)+cY_(t-2) + Z_t +Z_(t-1) + Z_(t-2) + X_t + M_t i.e. it is an ARMA(2,2) with some additional regressors X and M. [Z_t's are the white noise variables] How do I find the estimates of the coefficients in R? And also I would like t

Re: [R] R issue with unequal large data frames with multiple columns

2013-05-02 Thread PIKAL Petr
Hi without real data I can suggest you to look to ?merge. Or maybe ?aggregate. Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Adeel Amin > Sent: Thursday, May 02, 2013 8:28 AM > To: r-help@r-project.org > Subj

Re: [R] Sum objects in a column between an interval defined by conditions on another column

2013-05-02 Thread PIKAL Petr
Hi Just a question. Why you do not sum 5 with 3 and 4 or leave 3 alone and sum 4 and 5? Basically combination of cut and aggregate gives you what you want, but tricky is how to do the cut operation based on your requirements and data aggregate(df$B, list(df$A), sum) aggregates B for any singl

Re: [R] R issue with unequal large data frames with multiple columns

2013-05-02 Thread Jim Holtman
?duplicated ?intersect Sent from my iPad On May 2, 2013, at 2:28, Adeel Amin wrote: > I'm a bit of an amateur R programmer. I can do simple R scenarios but my > handle on complex grammatical issues isn't steady. > > I have 12 CSV files that I've read into dataframes. Each has 8 columns and >

Re: [R] Problems with reading data by readWorksheetFromFile of XLConnect Package

2013-05-02 Thread Anthony Damico
try adding colTypes = 'numeric' to your readWorkSheetFromFile() call if that doesn't work, try a few other steps # view what data types your file is being read in as sapply( temp , class ) # convert all fields to character if they're factor variables.. but i don't think you need this, readWo

Re: [R] saving a matrix

2013-05-02 Thread Jim Holtman
?save ?load Sent from my iPad On May 2, 2013, at 3:47, Preetam Pal wrote: > Hi all, > > In my data analysis, > > I have created a random matrix M ( of order 500 X 7). > > I want to use the same matrix when I start a new session, or suppose I want > to send this matrix to one of my friends (b

Re: [R] saving a matrix

2013-05-02 Thread PIKAL Petr
Hi just before generation of a matrix use set.seed. Or save this matrix by saveRDS. Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Preetam Pal > Sent: Thursday, May 02, 2013 9:47 AM > To: r-help@r-project.org > Subjec

Re: [R] Stochastic Frontier: Finding the optimal scale/scale efficiency by "frontier" package

2013-05-02 Thread jpm miao
Dear Arne, Thank you very much for your response. I will certainly read it carefully and if I have further questions (after our discussion on this problem), I will go to R forge. I am relatively new in SFA and productivity analysis. Regarding your question on the presence of any software impo

[R] ODE solver

2013-05-02 Thread Tjun Kiat Teo
I am trying to use the package ode and periodically it will come up with this error message Warning..Internal T (=R1) and H (=R2) are such that in the machine, T + H = T on the next step (H = step size). Solver will continue anyway. And then the program just take very long to run. Is there an

[R] saving a matrix

2013-05-02 Thread Preetam Pal
Hi all, In my data analysis, I have created a random matrix M ( of order 500 X 7). I want to use the same matrix when I start a new session, or suppose I want to send this matrix to one of my friends (because this matrix is randomly generated, and I dont want to use any other 500X7 matrix rando

[R] modMCMC runs in FME package

2013-05-02 Thread Andras Farkas
Dear All,   please help with some thoughts on overcoming the following issues, if possible:   #R Code   require(deSolve) require(FME) pars <- list(k = 0.06,v=18) intimes <- c(0,0.5,12,12.5,50) input   <- c(800,0,800,0,0) forc <- approxfun(intimes, input, method="constant") model <- function(pars, t