[R] easy way to fit saturated model in sem package?

2012-07-12 Thread Joshua Wiley
Hi, I am wondering if anyone knows of an easy way to fit a saturated model using the sem package on raw data? Say the data were: mtcars[, c(mpg, hp, wt)] The model would estimate the three means (intercepts) of c(mpg, hp, wt). The variances of c(mpg, hp, wt). The covariance of mpg with hp

Re: [R] nls problem: singular gradient

2012-07-12 Thread Jonas Stein
On 07/12/2012 01:39 AM, Duncan Murdoch wrote: On 12-07-11 2:34 PM, Jonas Stein wrote: Take a look at the predicted values at your starting fit: there's a discontinuity at 0.4, which sure makes it look as though overflow is occurring. I'd recommend expanding tanh() in terms of exponentials and

[R] Results from mixed linear models

2012-07-12 Thread Julien Leblud
Dear list, I'm quite confused when interpreting results from a mixed linear model. For example, working on Iris data frame, I want to know the effect of species on slope of the model Petal.Length~Sepal.Length I write this : data(iris) reg01 - lm(Petal.Length~Sepal.Length +

Re: [R] Subset based on multiple values

2012-07-12 Thread arun
Hi, Try this: (a variant of andrija)  testct-table(test)  subset(test,!is.na(match(test,as.integer(names(testct[testct%in%max(testct)])     [,1] [1,]    1 [2,]    1 [3,]    1 [4,]    1 [5,]    7 [6,]    7 [7,]    7 [8,]    7 A.K. - Original Message - From: Amanduh320

Re: [R] Help with loop

2012-07-12 Thread arun
Hi, Try this: func1-function(x,y,z)  {ifelse(is.na(y[[x]]),z[[x]],y[[x]])} dat3-data.frame(lapply(colnames(df1),function(x) func1(x,df1,df2))) colnames(dat3)-colnames(df1) dat3   cola colb  colc cold cole 1  1.4  5.0  9.00  1.6 17.0 2  1.4  6.0  0.02 14.0  0.6 3  3.0  0.8 11.00 15.0 19.0 4 

[R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Rantony
Hi, Here i have a matrix like this, OLDMatrix - X1 X2X3 - ---- 22 24 23 25 27 27 10 13 15 the thing is, im running two function(SUM,COUNT) to get output in another matrix called NEWMatrix NEWMatrix -

Re: [R] apply() to a function that has more than 2 arguments

2012-07-12 Thread Prof Brian Ripley
On 12/07/2012 07:10, Dimitris.Kapetanakis wrote: Dear all, I created a function which it has many arguments i.e. Mu(x, Y, B, X, P) where Mu is the function. This function works perfect but when I am trying to use it in the apply() function in the manner apply(Matr, 1, Mu, Y=y, B=b, X=x, P=p) it

Re: [R] Extracting arithmetic mean for specific values from multiple .txt-files

2012-07-12 Thread vimmster
Dear Mr. Holtman and especially dear Rui, thank you VERY much. You helped me a lot! I've just added the following: rsort - ratios[order(ratios$vpNum),] Now the test subjects are arranged according to their vpNum. Thanks a lot again! -- View this message in context:

[R] plot graph by first letter

2012-07-12 Thread imnew
Hi all, may i know is it possible to plot a graph by first letter? for example: Name: Age: Angel20 Amelia 20 Bernard 19 Stephanie 20 Vanessa 22 Angeline 23 Camel

Re: [R] do I need plyr, apply or something else?

2012-07-12 Thread Russell Bowdrey
Michael, Mikhail Many thanks for your helpful comments. My faith in community support continues to grow. Michael: I'm looking to use some sort of flexible spline-like fit (smooth.spline, lowess etc). Many thanks for sharing your expertise. I actually cross posted this on to the manipulatr

Re: [R] Conjoint Analysis in R??

2012-07-12 Thread fasidfas
I have developed a package for conjoint analysis in R, you may use package faisalconjoint. -- View this message in context: http://r.789695.n4.nabble.com/Conjoint-Analysis-in-R-tp842239p4636267.html Sent from the R help mailing list archive at Nabble.com.

[R] How to Read source code of function as string vector or matrix

2012-07-12 Thread purushothaman
Hi, I need to read source code of function as a string vector or matrix. if i am using get method it return as closure type. example readcsv-function(filepath) { output-read.csv(filepath) } how to get as string vector like this test[1]=readcsv-function(filepath) test[2]={

Re: [R] How to Read source code of function as string vector or matrix

2012-07-12 Thread Thomas Petzoldt
On 7/12/2012 11:00 AM, purushothaman wrote: Hi, I need to read source code of function as a string vector or matrix. if i am using get method it return as closure type. example readcsv-function(filepath) { output-read.csv(filepath) } how to get as string vector like this

Re: [R] MODE , VARIANCE , NTH PERCENTAILE

2012-07-12 Thread Jim Lemon
On 07/11/2012 05:38 PM, Rantony wrote: Hi, Here i have an matrix like this, ABCPQRXYZ MNO -- --- -- 367 15 2 122415 20 5 1 2 25 50 15 35 i need to get the

Re: [R] How to Read source code of function as string vector or matrix

2012-07-12 Thread purushothaman
Hi, readLines read a file and retrun as vector. i need to read particular function in Rfile. Thanks B.Purushothaman -- View this message in context: http://r.789695.n4.nabble.com/How-to-Read-source-code-of-function-as-string-vector-or-matrix-tp4636270p4636273.html Sent from the R help mailing

Re: [R] nls problem: singular gradient

2012-07-12 Thread peter dalgaard
On Jul 11, 2012, at 20:34 , Jonas Stein wrote: Take a look at the predicted values at your starting fit: there's a discontinuity at 0.4, which sure makes it look as though overflow is occurring. I'd recommend expanding tanh() in terms of exponentials and rewrite the prediction in a way

[R] Generate random numbers with nested Archimedean Copula

2012-07-12 Thread Kellner
Hi everybody, I try to simulate random numbers from a trivariate nested Archimedean copula. My aim is to correlate two processes with, e.g. theta2, as the so called child pair and then to correlate these two processes with a third one with theta1 (parent). This figure tries to capture what I am

Re: [R] plot graph by first letter

2012-07-12 Thread Sarah Goslee
This looks a bit like homework, and makes no attempt whatsoever to follow the posting guide or present previous work. But still, I'd start with ?grepl, and move on to use rseek.org to look for functions for whatever kind of plot you need to make. The R Graph Gallery is also a good resource. And

Re: [R] MODE , VARIANCE , NTH PERCENTAILE

2012-07-12 Thread Rantony
Hi Jim, Thanks alots for helping me. Is it possible to get the any percentile without using library? Thanks -Antony. From: Jim Lemon [via R] [mailto:ml-node+s789695n4636272...@n4.nabble.com] Sent: Thursday, July 12, 2012 2:46 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re:

[R] Caret: Use timingSamps leads to error

2012-07-12 Thread Dominik Bruhn
I want to use the caret package and found out about the timingSamps obtion to obtain the time which is needed to predict results. But, as soon as I set a value for this option, the whole model generation fails. Check this example: - library(caret)

[R] using glmnet for the dataset with numerical and categorical

2012-07-12 Thread yan
Dear R users, if all my numerical variables in my datasets having the same units, may I leave them unnormalized, just do cv.glmnet directly(cv.glmnet(data,standardize=FALSE))? i know normally if there is a mixture of numerical and categorical , one has to standardize the numerical part before

Re: [R] Import single variables from SPSS

2012-07-12 Thread Marion Wenty
Dear Eik, yes, with the memisc package I was able to import only a few variable of the SPSS dataframe! Thank you very much for your help! Marion 2012/7/5 Eik Vettorazzi e.vettora...@uke.de Hi Marion, package memisc does what you want, just have a look at ?importers. Hth Eik Am 05.07.2012

[R] I: ensembleBMA pit function warnings

2012-07-12 Thread anna freni sterrantino
Hello! I'm having some problems with  pit function in ensembleBMA. When I run on mu data I have the same warnings as below, when I type the example(pit). Any suggestion on how to resolve it? library(ensembleBMA) Loading required package: chron example(pit) pit   data(ensBMAtest) pit  

Re: [R] Modifying the design matrix X in GAMS to suit data assimilation

2012-07-12 Thread Simon Wood
Eli, I think that this should be possible. If your integration allows you to express the salinity as a weighted sum of evaluated values of the spatial smooth function (where the weights are known), then you could use the summation convention for smooths described in ?linear.functional.terms.

[R] How to get all list item to one string variable

2012-07-12 Thread purushothaman
Hi, How to get all list item to one string variable. example a[1]=abc b[1]=def output=abc def Thanks B.Purushothaman -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-all-list-item-to-one-string-variable-tp4636283.html Sent from the R help mailing list archive at

Re: [R] I need to get function name from R file

2012-07-12 Thread purushothaman
it's working Thank You so much B.purushothaman -- View this message in context: http://r.789695.n4.nabble.com/I-need-to-get-function-name-from-R-file-tp4636136p4636284.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] How to get all list item to one string variable

2012-07-12 Thread Sarah Goslee
With paste(). On Thursday, July 12, 2012, purushothaman wrote: Hi, How to get all list item to one string variable. example a[1]=abc b[1]=def output=abc def Thanks B.Purushothaman -- View this message in context:

Re: [R] How to get all list item to one string variable

2012-07-12 Thread purushothaman
hi, sorry it's not 2 different list all item in same list like this a[1]=abc a[2]=def ... output =abc def ... Thanks B.Purushothaman -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-all-list-item-to-one-string-variable-tp4636283p4636287.html Sent from the R help

Re: [R] identifying local maxima

2012-07-12 Thread Hans W Borchers
Gary Dong pdxgary163 at gmail.com writes: Dear R users, I have created a Loess surface in R, in which x is relative longitude by miles, y is relative latitude by miles, and z is population density at the neighborhood level. The purpose is to identify some population centers in the region.

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Jean V Adams
Try using the rbind() function to combine the two vectors from colSums() into a matrix. Then assign row names and get rid of column names using the dimnames() function. For example: OLDMatrix - matrix(c(22, 25, 10, 24, 27, 13, 23, 27, 15), ncol=3, dimnames = list(NULL, c(X1, X2,

Re: [R] How to get all list item to one string variable

2012-07-12 Thread arun.gurubaramurugeshan
Try this... a-c(abc,def,ghi,klm,nop,qrs,tuv,wxyz) b-data.frame() for (i in 1:length(a)){ b-paste(b,a[i],sep=) } print(b) Thanks Arun --- -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-all-list-item-to-one-string-variable-tp4636283p4636291.html Sent from the R help

Re: [R] How to get all list item to one string variable

2012-07-12 Thread Ivan Calandra
Hi, What you did is equivalent to, but more complicated (and slower as well I guess) than: paste(a, collapse=) Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.calan...@u-bourgogne.fr

Re: [R] How to get all list item to one string variable

2012-07-12 Thread Petr Savicky
On Thu, Jul 12, 2012 at 05:22:45AM -0700, purushothaman wrote: hi, sorry it's not 2 different list all item in same list like this a[1]=abc a[2]=def ... output =abc def ... Hi. Try this a - list(abc, def, ghi) paste(a, collapse= ) [1] abc def ghi Hope this helps. Petr

[R] A simple simulation question

2012-07-12 Thread Aldous Huxley
Hi! I would like to post the following question: I was trying to figure out how to do the simulation shown in Fig 10.6 of John Verzani's book 'Using R for Intro Statistics'. It is on page 290, with a description on the previous page. It seems like a simple thing... Just needing to duplicate a

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread Rantony
Thanks jean. From: Jean V Adams [via R] [mailto:ml-node+s789695n4636289...@n4.nabble.com] Sent: Thursday, July 12, 2012 6:14 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Add row into a Matrix witout headers from Function Try using the rbind() function to combine the two vectors

[R] Warning message with read.csv.sql

2012-07-12 Thread Bharat Warule
Hello, I am using read.csv.sql first time for reading the large data file.If I am ran this code that showns warning “closing unused connection”. Is it I am missing any argument from my command or how to comeout from this warning?. R code:- Library(sqldf) ip_dir_path -

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread arun
Hello, The reason you are only getting one row is because each time you are replacing the NEWMatrix with new output. Try this: Oldmatrix-read.table(text=  X1    X2    X3  22  24    23  25  27    27  10  13    15  ,sep=,header=TRUE) NewMatrix1-rbind(

Re: [R] How to get all list item to one string variable

2012-07-12 Thread arun
Hi, If I understand it correctly, probably this is what you want: a-list(abc,def,ghi)  a1-unlist(a)  paste(a1[1],a1[2],a1[3],sep= ) [1] abc def ghi A.K. - Original Message - From: purushothaman purushothama...@ge.com To: r-help@r-project.org Cc: Sent: Thursday, July 12, 2012 8:22 AM

Re: [R] Add row into a Matrix witout headers from Function

2012-07-12 Thread arun
Hi Jean, If we convert the NEWMatrix to dataframe,then headers do appear. NewMatrix1-data.frame(NewMatrix)  NewMatrix1 X1 X2 X3 X4 SumMatrix   SUM 57 64 65 CountMat  COUNT  3  3  3 #assigning headers to NULL  colnames(NewMatrix1)-NULL  NewMatrix1 NA NA NA NA

Re: [R] A simple simulation question

2012-07-12 Thread Ivan Calandra
Hi Manning, There are two obvious mistakes: - close the brackets for replicate() and - do the things in the correct order replicate(100, { x=rep(1:10,10) ## first define x y=rnorm(100,x,5) ## and then y because it depends on x plot(y~x) ## then plot, because it depends on x

Re: [R] using glmnet for the dataset with numerical and categorical

2012-07-12 Thread Bert Gunter
... and you are unlikely to get a helpful reply until you follow the posting guide and post code that shows what you did. Unless there's a claiRvoyant package out there somewhere to figure it out. -- Bert On Thu, Jul 12, 2012 at 3:43 AM, yan y.j...@ucl.ac.uk wrote: Dear R users, if all my

Re: [R] Results from mixed linear models

2012-07-12 Thread Bert Gunter
Post on the r-sig-mixed-models list, not here.* -- Bert * Or consult a local statistician, as your problem appears to be insufficient statistical knowledge, rather than R-related. In particular, fitting a (mixed effect) linear model without an intercept is almost always unwise. On Thu, Jul 12,

Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-12 Thread scstrein
Thanks! For some reason, example 5 in that documentation doesn't work for me. It runs the query, but I'm getting zero results. If I substitute the variable with the actual value, I do get the results I want. Is there a reason for this? -- View this message in context:

[R] How to handle NA-values in raster-based Geary´s C test?

2012-07-12 Thread Kerstin Traut
Hi, I have a question on testing spatial autocorrelation on raster data including NA-values. In particular, I like to calculate Moran´s I and Geary´s C indices by using inverse distance weighting matrices. Calculating Moran´s I with moran.test works fine, because the function contains the

[R] nls problem: singular gradient

2012-07-12 Thread John C Nash
Duncan has given a indication of why nls() has troubles, and you have found a way to work around the problem partially. However, you may like to try nlmrt (from R-forge project R-forge.r-project.org/R/?group_id=395 It is intended to be very aggressive in finding a solution, and also to deal

Re: [R] A simple simulation question

2012-07-12 Thread John Kane
I think that you have the statements out of order and I know that you are lacking the last ) to match the replicate( Try this replicate(100, { x=rep(1:10,10) y=rnorm(100,x,5) plot(y~x) abline(lm(y~x)) }) John Kane Kingston ON Canada -Original Message- From: aldoushuxle...@gmail.com

Re: [R] plot graph by first letter

2012-07-12 Thread John Kane
I really am not sure of the question but perhaps ?order for a start? John Kane Kingston ON Canada -Original Message- From: jubil...@live.com.sg Sent: Thu, 12 Jul 2012 01:15:26 -0700 (PDT) To: r-help@r-project.org Subject: [R] plot graph by first letter Hi all, may i know is it

Re: [R] plot only a same variable timing graph

2012-07-12 Thread John Kane
?subset John Kane Kingston ON Canada -Original Message- From: jubil...@live.com.sg Sent: Wed, 11 Jul 2012 20:53:51 -0700 (PDT) To: r-help@r-project.org Subject: [R] plot only a same variable timing graph hi all. for example : Table 1 variable: BERTH TIME A

Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 9:41 AM, scstrein scstr...@ncsu.edu wrote: Thanks! For some reason, example 5 in that documentation doesn't work for me. It runs the query, but I'm getting zero results. If I substitute the variable with the actual value, I do get the results I want. Is there a reason

Re: [R] is it possible to insert a figure into into another new figure by r script

2012-07-12 Thread Greg Snow
You could read the .png (or some other formats) in then use the rasterImage function to put that into the current plot. On Mon, Jul 9, 2012 at 8:25 PM, Jie Tang totang...@gmail.com wrote: hi R-users Now I have a figure in emf or png or tiff format that have been drawn by other tool and I

Re: [R] How to Read source code of function as string vector or matrix

2012-07-12 Thread Michael Weylandt
?deparse And please include context -- relatively few of us use Nabble. Michael On Jul 12, 2012, at 4:16 AM, purushothaman purushothama...@ge.com wrote: Hi, readLines read a file and retrun as vector. i need to read particular function in Rfile. Thanks B.Purushothaman -- View

Re: [R] easy way to fit saturated model in sem package?

2012-07-12 Thread John Fox
Dear Joshua, If I understand correctly what you want to do, the sem package won't do it. That is, the sem() function won't do what often is called FIML estimation for models with missing data. I've been thinking about implementing this feature, and don't think that it would be too difficult, but

Re: [R] easy way to fit saturated model in sem package?

2012-07-12 Thread Rui Barradas
Hello, There's a package, lavaan, that implements FIML as an option of function sem(). I have never used it, though, so I can't say much about it. Hope this helps, Rui Barradas Em 12-07-2012 16:20, John Fox escreveu: Dear Joshua, If I understand correctly what you want to do, the sem

Re: [R] igraph function graph.bfs unavailable

2012-07-12 Thread Gábor Csárdi
Hi David, please make sure that you have the 0.6 version of igraph installed. You might need to upgrade your R installation to install the 0.6 version of igraph. Best, Gabor On Wed, Jul 11, 2012 at 10:36 AM, David Marx dm...@soundexchange.com wrote: Hi, I've installed the igraph package and

[R] trellis margin sizes in absolute units

2012-07-12 Thread Martin Ivanov
Dear R users, I have a lot of experience with traditional R graphics, but I decided to turn to trellis as it was recommended for spatial graphs by the sp package. In traditional R graphics I always first set the size of the device region absolute units (e.g. mm) and then I firmly fix the

Re: [R] trellis margin sizes in absolute units

2012-07-12 Thread Bert Gunter
It is not clear to me what you want in the lattice context, but perhaps ?print.trellis may be relevant. Note that inner and outer margins are not directly translatable in lattice, as there are multiple levels of plots involved, all determined by viewport contexts. Ergo my confusion about what

Re: [R] How to use external image with R plot?

2012-07-12 Thread Greg Snow
You can use the locator function to retrieve the user coordinates of a point that you click on in the plot, then use those points with rasterImage to add the image. So replace the last 2 lines of Michael's answer with something like: barplot(VADeaths, border = dark blue) tmp - locator(1)

Re: [R] How to add marker in Stacked bar plot?

2012-07-12 Thread Greg Snow
If you want something other than an arrow (or an arrow that looks different from those produced by the arrows function) then look at the my.symbols function in the TeachingDemos package. On Mon, Jul 9, 2012 at 9:37 PM, Manish Gupta mandecent.gu...@gmail.com wrote: Hi, I am working on stacked

Re: [R] Computing inverse cdf (quantile function) from a KDE

2012-07-12 Thread Greg Snow
If you are going to be doing a lot of this then you might want to consider using logspline density estimates (logspline package) instead of kernel density estimates. On Wed, Jul 11, 2012 at 8:33 AM, firdaus.janoos fjan...@bwh.harvard.edu wrote: Hello, I wanted to know if there is a simple way

[R] nls question

2012-07-12 Thread Felipe Carrillo
 Hi:  Using nls how can I increase the numbers of iterations to go beyond 50.  I just want to be able to predict for the last two weeks of the year.  This is what I have:  weight_random - runif(50,1,24)  weight - sort(weight_random);weight weightData - data.frame(weight,week=1:50)

Re: [R] nls question

2012-07-12 Thread Prof Brian Ripley
See ?nls.control (referenced from ?nls). On 12/07/2012 18:47, Felipe Carrillo wrote: Hi: Using nls how can I increase the numbers of iterations to go beyond 50. I just want to be able to predict for the last two weeks of the year. This is what I have: weight_random - runif(50,1,24)

Re: [R] nls question

2012-07-12 Thread Bert Gunter
Read the Help file! ?nls ## Note the control argument ?nls.control -- Bert On Thu, Jul 12, 2012 at 10:47 AM, Felipe Carrillo mazatlanmex...@yahoo.comwrote: Hi: Using nls how can I increase the numbers of iterations to go beyond 50. I just want to be able to predict for the last two weeks

Re: [R] How to Read source code of function as string vector or matrix

2012-07-12 Thread jim holtman
try this: readcsv-function(filepath) + { + output-read.csv(filepath) + } readcsv function(filepath) { output-read.csv(filepath) } x - capture.output(readcsv) x [1] function(filepath) { output-read.csv(filepath) [4] } On Thu, Jul 12, 2012 at 5:00 AM, purushothaman

[R] permutation test on paired samples

2012-07-12 Thread Holger Taschenberger
Hi, I'm trying to run a permutation test on paired samples. First I tried the package exactRankTests: require(exactRankTests) x - c(1.83,0.50,1.62,2.48,1.68,1.88,1.55,3.06,1.30) y - c(0.878,0.647,0.598,2.05,1.06,1.29,1.06,3.14,1.29) wilcox.test(x,y,paired = TRUE,alternative = greater)

[R] Two R sessions on multicore computer seem to inhibit each other ?

2012-07-12 Thread Ulrike Grömping
Dear R-helpers, I am puzzled by the following observation: On my home dual core Windows desktop computer, I am used to running two R sessions in parallel. These do very well in using the full CPU of the computer (half each) and don't seem to slow each other down. Today I have started some large

[R] SVAR Restriction on AB-model

2012-07-12 Thread vero_acurio
Hello! I'm doing a svar and when I make the estimation the next error message appears: In SVAR(x, Amat = amat, Bmat = bmat, start = NULL, max.iter = 1000, : The AB-model is just identified. No test possible. Could you help me to interpret it please. Also I have the identification assumption

[R] duplicate couples (time-id) Problem

2012-07-12 Thread Saint
Hi! Would be grateful if somebody helped me understand this error message after trying to run a panel data: PanelData - read.xls(/Users/Bahman/Desktop/Taylor rule/Data/PanelData2.xls) attach(PanelData) # Panel Data regresson for all countrys. Answer - plm(NOM.INT.RATE ~ INFL + TARGET.INFL +

Re: [R] Modifying the design matrix X in GAMS to suit data assimilation

2012-07-12 Thread esatel
Thanks Simon! I can use the functional approach to bridge the gap between this and more traditional forms of data assimilation. At the moment, though, what I am doing is related to your work with soap films, in which your response comes from linearly combine solutions of a PDE evaluated at the

Re: [R] plot graph by first letter

2012-07-12 Thread arun
Hi, Try this: dat1-read.table(text=  Name  Age  Angel    20  Amelia  20  Bernard  19  Stephanie  20  Vanessa  22  Angeline  23  Camel  21  ,sep=,header=TRUE)

[R] Writing HAR-RV-CJ Model?

2012-07-12 Thread cursethiscure
I am trying to write a loop to forecast realized volatility over successive days for the purpose of VaR prediction using the HAR-RV-CJ model which is as follows: log(RV_t+1) = β_0 + β_CD log(CV_t) + β_CW log(CV_t-5) + β_CM log(CV_t-22) + β_JD log(J_t) + β_JW J_t-5 + β_JM J_t-22 + e_t where

[R] Grabbing Indexes of a certain standard deviation

2012-07-12 Thread gcm
I have a graph of residuals and I am attempting to get a list of the indexes of each time the residual is greater than 2 standard deviations or less than -2 standard deviations, but only the first point of the section. And then I'd also need the first point where the point returns to the range

[R] HAR-RV-CJ Moedel

2012-07-12 Thread cursethiscure
I am trying to write a loop to forecast realized volatility over successive days for the purpose of VaR prediction using the HAR-RV-CJ model which is as follows: log(RV_t+1) = β_0 + β_CD log(CV_t) + β_CW log(CV_t-5) + β_CM log(CV_t-22) + β_JD log(J_t + 1) + β_JW log(J_t-5 + 1) + β_JM

Re: [R] unable to subtract dates in R

2012-07-12 Thread arun
Hi William, Glad to know that. So, I guess difftime() did the trick if both befong to the class Date. A.K. From: William Mabe billm...@gmail.com To: arun smartpink...@yahoo.com Sent: Thursday, July 12, 2012 1:12 PM Subject: Re: [R] unable to subtract dates

Re: [R] igraph function graph.bfs unavailable

2012-07-12 Thread David Marx
Hi Gabor, I updated my RStudio installation to 0.96.316 (which did not modify my R build of 2.14.0) and that did it. Thanks for the help! David Marx Please note our office has moved: David Marx | Data Analyst Specialist, Claims Dept | SoundExchange, Inc. 733 10th Street, NW | 10th Floor |

[R] Enforcing inequality bounds and heteroscedasticity in a GAM or GLM

2012-07-12 Thread Ateljevich, Eli
I have a spatial salinity field s and a model g(s) ~ Xb where the X comes from slightly modified GAM basis functions. I am trying to deal with the following set of requirements: 1. The underlying physics are linear, and plain salinity (the identity link) is the correct response to my

Re: [R] remove loop which compares row i to row i-1

2012-07-12 Thread jcrosbie
Thank you, I am sorry but I am still trying to figure out how to make the function work. I have a column called tUnitsort$BlockNumber which can range from 0 to 6. I have another two columns with the date and the hour ending for the given day. Example DateHour BlockNumber MyTo

[R] read.table with numeric row names

2012-07-12 Thread kexinz
I have a text file like this 2.5 3.6 7.1 7.9 100 3 4 2 3 200 3.1 4 3 3 300 2.2 3.3 2 4 I used r - read.table(a.txt, header=T) The row names becomes X2.5, X3.6... What I need is the row names are numeric, so I can use the row names as numbers on

Re: [R] How to get all list item to one string variable

2012-07-12 Thread arun
HI, Much more simplified code that my previous one.  a-list(abc,def,ghi, jkl, mno, pqr)  paste(a[],sep= ) [1] abc def ghi jkl mno pqr A.K. - Original Message - From: purushothaman purushothama...@ge.com To: r-help@r-project.org Cc: Sent: Thursday, July 12, 2012 8:22 AM Subject: Re:

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
Thanks Bert, I increased the  number of iterations:   M_model - nls(weight ~ alpha + beta*exp(gamma*week),control=nls.control(maxiter=200), weightData, start = c(alpha = 0.0, beta = 1, gamma = 0.2), trace = TRUE)   But now the 'start' argument seems to be the problem. Looking at the

Re: [R] Caret: Use timingSamps leads to error

2012-07-12 Thread Max Kuhn
I can reproduce the errors. I'll take a look. Thanks, Max On Thu, Jul 12, 2012 at 5:24 AM, Dominik Bruhn domi...@dbruhn.de wrote: I want to use the caret package and found out about the timingSamps obtion to obtain the time which is needed to predict results. But, as soon as I set a value

Re: [R] nls question

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo mazatlanmex...@yahoo.com wrote: Thanks Bert, I increased the number of iterations: M_model - nls(weight ~ alpha + beta*exp(gamma*week),control=nls.control(maxiter=200), weightData, start = c(alpha = 0.0, beta = 1, gamma = 0.2),

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
I get a different error now:   nls(weight ~ cbind(1, exp(gamma*week)), weightData, start = list(gamma= 0.2), alg = plinear) Error in nls(weight ~ cbind(1, exp(gamma * week)), weightData, start = list(gamma = 0.2),  :   step factor 0.000488281 reduced below 'minFactor' of 0.000976562 The help

Re: [R] nls question

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 3:40 PM, Felipe Carrillo mazatlanmex...@yahoo.com wrote: I get a different error now: nls(weight ~ cbind(1, exp(gamma*week)), weightData, start = list(gamma= 0.2), alg = plinear) Error in nls(weight ~ cbind(1, exp(gamma * week)), weightData, start = list(gamma = 0.2),

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-12 Thread Patrick Connolly
On Tue, 10-Jul-2012 at 11:19PM +0200, Erdal Karaca wrote: | german Null == english zero :-) German Gift == English poison :-( | | 2012/7/10 Rolf Turner rolf.tur...@xtra.co.nz | | | | In addition to taking cognisance of Richard Heiberger's reply you | should also learn to

[R] Predicted values when using offset in ZIP GLM

2012-07-12 Thread Lee, Laura
Hi all! I have built a model to predict interactions with turtles and the model includes an offset for effort: ZIP-zeroinfl(Sturgeon~fMesh+fSeason+offset(LogEffort),dist=poisson,link=logit,data=data) I wasn't clear about one aspect of the response to a similar question I recently posted...I

Re: [R] read.table with numeric row names

2012-07-12 Thread arun
Hi, Try this: dat1-read.table(text=  2.5  3.6  7.1  7.9  100  3  4  2    3  200  3.1  4  3  3  300  2.2  3.3  2    4  ,sep=,header=TRUE) #Either colnames(dat1)-c(2.5,3.6,7.1,7.9) #or colnames(dat1)-c(2.5,3.6,7.1,7.9) #produce character column names  

Re: [R] Questions about doing analysis based on time

2012-07-12 Thread APOCooter
Another new question: I want to be able to subset the data based on whether or not that data point was recorded on a holiday. The is.holiday() function from the chron package would be perfect for this. However, when I try it, the following happens (I'm also using the timeDate package):

Re: [R] nls question

2012-07-12 Thread Bert Gunter
To add to Gabor's remarks: This has nothing to do per se with R -- it is your insufficient understanding of the underlying mathematical issues. It is pretty trivial to do the plinear algorithm by hand. Fit linear regressions weight ~ lm(weight ~z) where z is exp(gamma*week) for a suitable

Re: [R] read.table with numeric row names

2012-07-12 Thread Yasir Kaheil
just do this: colnames(r)-substr(colnames(r),2,nchar(colnames(r))) This will remove the X. Later when you want to use the headed to plot something, cast it as numeric: plot(colMeans(r)~as.numeric(colnames(r))) - Yasir Kaheil -- View this message in context:

Re: [R] Two R sessions on multicore computer seem to inhibit each other ?

2012-07-12 Thread Ulrike Grömping
P.S.: I should have mentioned: The operating system is Windows XP. -- View this message in context: http://r.789695.n4.nabble.com/Two-R-sessions-on-multicore-computer-seem-to-inhibit-each-other-tp4636336p4636355.html Sent from the R help mailing list archive at Nabble.com.

[R] lars package to do lasso

2012-07-12 Thread SHIR SHIRY
Dear all I am using lars package to do lasso in R. I dont undesrtand what max.steps do?and how I can understand from the outputs to obtain the last steps in this packagethanks for your helpbest [[alternative HTML version deleted]] __

Re: [R] lars package to do lasso

2012-07-12 Thread Bert Gunter
If you don't understand the methodology, why are you using it?? Use the glmnet package instead and read the supporting documents. If it's too technical for you, consult a statistician or do something else. I do NOT do brain surgery. -- Bert On Thu, Jul 12, 2012 at 1:04 PM, SHIR SHIRY

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
Thank you all for your help. Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: Gabor Grothendieck ggrothendi...@gmail.com To: Felipe Carrillo

[R] How to find frequent sequences.

2012-07-12 Thread Vineet Shukla
I have independent event sequences for example as follows : Independent event sequence 1 : A , B , C , D Independent event sequence 2 : A, C , B Independent event sequence 3 :D, A, B, X,Y, Z Independent event sequence 4 :C,A,A,B Independent event sequence 5 :B,A,D I want to able to

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-12 Thread Jean V Adams
I wrote a little function called first() to help with situations like this. It returns a 1 every time an element of a vector is different from the previous element, and a 0 otherwise. first - function(x) { L - length(x) c(1, 1-(x[-1]==x[-L])) } sd - 1 residuals - c(1, 2.1, 3, 4,

Re: [R] Predicted values when using offset in ZIP GLM

2012-07-12 Thread Achim Zeileis
On Thu, 12 Jul 2012, Lee, Laura wrote: Hi all! I have built a model to predict interactions with turtles and the model includes an offset for effort: ZIP-zeroinfl(Sturgeon~fMesh+fSeason+offset(LogEffort),dist=poisson,link=logit,data=data) Note that this includes the offset both in the

Re: [R] remove loop which compares row i to row i-1

2012-07-12 Thread Rui Barradas
Hello, I've not been following this thread but this seems ndependent from previous posts. Try the following. url - http://r.789695.n4.nabble.com/file/n4636337/BR3_2011_New.csv; tUnitsort - read.csv(url, header=TRUE) cols - sapply(c(Date, Hour, BlockNumber, MyTo), function(x)

[R] Adjusting format of boxplot

2012-07-12 Thread David Arnold
Hi, I managed to use the attached data set and figure out the following: flies - read.table(example12_1.dat,header=TRUE,sep=\t) boxplot(long ~ group, data = flies, horizontal = TRUE, col = red) I'm very new to R and would like some help with the following: 1. Change the

Re: [R] Plotting rpart trees with long list of class members

2012-07-12 Thread Jean V Adams
The example you gave had only one split. If your real situation has three splits, you'll have to take a look at testtree$csplit matrix and decide how you want to define the new grouping variable. Here's one way to do it ... Jean library(rpart) library(rpart.plot) test_set - data.frame(

Re: [R] Adjusting format of boxplot

2012-07-12 Thread darnold
Looks like data was not attached. Here is is. longgroup 40 1 37 1 44 1 47 1 47 1 47 1 68 1 47 1 54 1 61 1 71 1 75 1 89 1 58 1 59 1 62 1 79 1 96 1 58 1 62 1 70 1 72 1 74 1 96

  1   2   >