Re: [R] SOS! error in GLM logistic regression...

2009-07-15 Thread Gavin Simpson
On Tue, 2009-07-14 at 15:57 -0700, Michael wrote: > Hi all, > > Could anybody tell me what happened to my logistic regression in R? > mylog=glm(mytraindata$V1 ~ ., data=mytraindata, family=binomial("logit")) > > It generated the following error message: > > Error in model.frame.default(Terms, ne

[R] The greatest common divisor between more than two integers

2009-07-15 Thread Atte Tenkanen
Hi, Do somebody know if there is a function in R which computes the greatest common divisor between several (more than two) integers? Best, Atte Atte Tenkanen University of Turku, Finland Department of Musicology +35823335278 http://users.utu.fi/attenka/ _

Re: [R] The greatest common divisor between more than two integers

2009-07-15 Thread Michael Knudsen
On Wed, Jul 15, 2009 at 8:55 AM, Atte Tenkanen wrote: > Do somebody know if there is a function in R which  computes the greatest > common divisor between several (more than two) integers? Is there a function for computing the greatest common divisor of *two* numbers? I can't find one, but assum

Re: [R] How to deploy statistical models built in R in real-time?

2009-07-15 Thread Allan Engelhardt
> > I am framing this as a question since I would like to know how folks > are currently deploying the models they build in R. Say, you want to > use the results of your model inside another application in real-time > or on-demand, how do you do it? How do you use the decisions you get > back from

[R] Starting RCmdr from the Commandline (and a shortcut) in Windows

2009-07-15 Thread Scott Hyde
I thought I'd share the experience I had in getting Rcmdr to start automatically when R starts up. I'd read of solutions that would start Rcmdr every time R started up, but I didn't want it to start every time, only when I wanted it to. First, I created a shortcut on the desktop to R and changed

Re: [R] How do I know where is R? - VB Programming

2009-07-15 Thread Gabor Grothendieck
This works on Linux (at least under bash shell) and also on Windows Vista and presumably earlier versions of Windows as well: R --vanilla --slave -e "R.home()" but the R part at the beginning does have the problem that it only works if R is on your path. If, on Windows, you normally double click

[R] loading multiple .Rdata and preserving variable names

2009-07-15 Thread Žroutík
Dear R-users, I need to load outputs from multiple previous calculations into one R session for comparison and (cross-)analysis. The previous calculations are stored in different directories in .Rdata files (I don't know if this is the best storage for later usage, but the previous project could b

Re: [R] Averaging dataframes that are stored in a list

2009-07-15 Thread baptiste auguie
Hi, you could try the reshape package, l = list(d1= data.frame(ID=letters[1:4],value=1:4), d2= data.frame(ID=letters[1:4],value= -c(1:4))) library(reshape) m = melt(l) cast(m, .~ID, fun=mean) HTH, baptiste 2009/7/15 Mark Na > Dear R-helpers, > I have a list containing 5000 elemen

Re: [R] loading multiple .Rdata and preserving variable names

2009-07-15 Thread Duncan Murdoch
On 15/07/2009 5:00 AM, Žroutík wrote: Dear R-users, I need to load outputs from multiple previous calculations into one R session for comparison and (cross-)analysis. The previous calculations are stored in different directories in .Rdata files (I don't know if this is the best storage for later

Re: [R] loading multiple .Rdata and preserving variable names

2009-07-15 Thread Barry Rowlingson
On Wed, Jul 15, 2009 at 10:41 AM, Duncan Murdoch wrote: > Given two .RData files, you can load them into separate environments. > Dealing with conflicting variables names is another issue, of course. > > For example: > > DataSet1 <- new.env() > load( "somefile", envir=DataSet1) > > Now use ls(Data

[R] (newbie) sum for certain number of rows

2009-07-15 Thread kelvin lau
I have following data in a data.csv file separated by space 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 etc... I wish to calculate the sum of each column for certain number of rows. For example i

[R] problems in resampling time series, block length, trend.test

2009-07-15 Thread Simone Santoro
Hi, I have a time series (say "x") of 13 years showing an evident increase. I want to exclude two observations (the fourth and 10th), so I do: > trend.test(x[-c(4,10)]) where: > x[-c(4,10)] [1]7 37 79 72 197 385 636 705 700 1500 1900 and I get: Spearman's rank correlatio

Re: [R] (newbie) sum for certain number of rows

2009-07-15 Thread Dimitris Rizopoulos
one way is the following: dat <- read.table(textConnection( "0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" )) closeAllConnections() k <- 3 ind <- rep(seq(1, nrow(dat)/k), each = k) rowsum(dat, ind)

[R] interacting variables in a formulae in R

2009-07-15 Thread Peter Schmidtke
Dear R Mailing Subscribers, I just have a question of how R handles interacting variables in model creation using glm for instance. if I write : >> model=glm(solution~descriptor1+descriptor2+descriptor3,family=binomial(link="logit")) I should end up with coefficients for a logistic model that

Re: [R] plotting confidence intervals

2009-07-15 Thread Jim Lemon
Erin Hodgess wrote: Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but that doesn't seem to do what I want

Re: [R] ggplot2: geom_errorbarh()

2009-07-15 Thread Benoit Boulinguiez
Hi, I expect 'width' to set the width of the horizontal line of the whisker, as it does with errobar() Regards/Cordialement Benoit Boulinguiez -Message d'origine- De : hadley wickham [mailto:h.wick...@gmail.com] Envoyé : dimanche 12 juillet 2009 11:04 À : Benoit Boulinguiez Cc : r-h

[R] end of daylight saving time

2009-07-15 Thread Denis Chabot
Hi, I read from the help on DateTimeClasses and various posts on this list that, quite logically, one needs to specify if DST is in function for the first hour after the change from DST to ST in autumn. Hence, in my time zone and on Mac OS X, I can do this: a <- as.POSIXct("2008-11-02 01:

Re: [R] (newbie) sum for certain number of rows

2009-07-15 Thread Gabor Grothendieck
In the zoo package, rollapply can do that. > library(zoo) > out <- rollapply(ts(dat), width = 3, by = 3, sum) > out Time Series: Start = 3 End = 9 Frequency = 0.333 V1 V2 V3 V4 V5 V6 V7 V8 3 1 0 1 1 1 1 1 1 6 1 1 1 1 0 0 1 1 9 2 3 2 3 3 2 3 2 This gives a "ts

[R] Quotes - useFancyQuotes

2009-07-15 Thread Paulo E. Cardoso
I need to get the exact sentence, with the quotes: OPTIONS COORDSYS("Surface1" AS COMPONENT); but this: options(useFancyQuotes = F) paste("OPTIONS COORDSYS(", dQuote("Surface 1"), "AS COMPONENT);" ) give me this: [1] "OPTIONS COORDSYS( \"Surface 1\" AS COMPONENT);" And it

Re: [R] Error when sampling from SpatialLines

2009-07-15 Thread Roger Bivand
Which version of the sp package are you using? In a version that is submitted to CRAN, and available for CVS checkout from the R-spatial sourceforge repository, a weakness was addressed when a Line object received no sample points, either because of its shortness, or because n is small for the tot

Re: [R] Matrix multiplication precision

2009-07-15 Thread Douglas Bates
On Wed, Jul 15, 2009 at 3:42 AM, Nair, Murlidharan T wrote: > Hi!! > I am trying to multiply 5 matrices and then using the inverse of that matrix > for further computation. I read about precision problems from the archives > and the suggestion was to use as.numeric while computing the products.

Re: [R] Re ad PNG file and display with more than 256 colors RGDAL

2009-07-15 Thread Roger Bivand
If you read the help page for the image method you are actually using: ?image.SpatialGridDataFrame you see that it supports red=, green=, and blue= arguments. This suggests that you could try: myTile <- readGDAL("basemap.png",silent=TRUE) class(myTile) summary(myTile) # assuming the positions a

Re: [R] Quotes - useFancyQuotes

2009-07-15 Thread Duncan Murdoch
On 15/07/2009 7:28 AM, Paulo E. Cardoso wrote: I need to get the exact sentence, with the quotes: OPTIONS COORDSYS("Surface1" AS COMPONENT); but this: options(useFancyQuotes = F) paste("OPTIONS COORDSYS(", dQuote("Surface 1"), "AS COMPONENT);" ) give me this: [1] "OPTI

[R] configure encoding by default

2009-07-15 Thread Угодай n/a
I want using russian letters for my diagrams. I do it in this manner m <- "заголовок" Encode(m) <- "UTF-8" plot(1,1,main=m) But it is not convenient . How to configure R for using UTF-8 for all string, to work without Encode-function, as plot(1,1,main="заголовок") [[al

[R] problem with merging matrices

2009-07-15 Thread jurgen claesen
Dear all, I'm a relative new user of R and I have a problem with merging a collection of matrices. All matrices in this collection have the same dimension (532 rows and 532 columns), but can differ in the row and columns names. I'd like to merge these matrices in such a way that the resulting matr

Re: [R] (simple) xml into data.frame and reverse

2009-07-15 Thread Duncan Temple Lang
Thanks Dieter. It should have been http://www.omegahat.org/RSXML/xmlToDataFrame.R as it is an R file. Thanks D. Dieter Menne wrote: Duncan Temple Lang wrote: I wrote some relatively general functions, but hastily written functions to read this sort of data. You can find them att

[R] Mixdist producing Na's and NaN's

2009-07-15 Thread Etienne B. Racine
When using mix() form the mixdist package, I sometimes get NA's and NaN's in the Standard Errors estimates. I've understood from the code that mix() it is using Non-linear minimization (nlm) to estimate thoses errors, but I can't understand how to interpret theses results. Does any one have a (web

Re: [R] configure encoding by default

2009-07-15 Thread Duncan Murdoch
On 7/15/2009 8:22 AM, Угодай n/a wrote: I want using russian letters for my diagrams. I do it in this manner m <- "заголовок" Encode(m) <- "UTF-8" plot(1,1,main=m) But it is not convenient . How to configure R for using UTF-8 for all string, to work without Encode-function, as plot(1,

Re: [R] ggplot2: geom_errorbarh()

2009-07-15 Thread hadley wickham
In ggplot2, you'll want to use size. Hadley On Wed, Jul 15, 2009 at 12:36 PM, Benoit Boulinguiez wrote: > Hi, > > I expect 'width' to set the width of the horizontal line of the whisker, as > it does with errobar() > > Regards/Cordialement > > > Benoit Boulinguiez > > > -Message d'origine-

Re: [R] hi friends, is there any wait function in R

2009-07-15 Thread Petr PIKAL
Hi deepak m r napsal dne 14.07.2009 16:07:16: > Hi, >I am not an expert to debug the R can u please help. > best regards > deepak See fortune("brain") You does not need to debug R. I believe R-Core will do it for you (If you really find some bug in R, which seems to be highly improbable).

Re: [R] nls, reach limit bounds

2009-07-15 Thread Ravi Varadhan
Hi Uyen, In addition to my suggestions in the previous email, you may also want to check to see if the LL.4 function in the "drc" package has the same parametrization as the function that you are using. Different parametrizations of the same model can have dramatically different convergence behav

[R] Question related to merging zoo objects and apply function

2009-07-15 Thread Sergey Goriatchev
Hello everyone, Say I have defined a convenience function in my code like this: func <- function(x, j){ x[168+j] <- x[72+j]+x[144+j] } And now I apply it to some columns in a big zoo object like this: for (m in 1:24){ combined <- merge(combined, LA1sum=apply(combined, 1, func,

[R] DECLARING A PANEL VARIABLE???

2009-07-15 Thread saurav pathak
Hi I am working on a panel data, my data are clustered/grouped by the variable "yearctry", I am running the regression below, but I cant make the regression recognise "yearctry" as the panel variable in the regression myProbit<- glm(s ~ age + gender + gemedu + gemhinc + es_gdppc + imf_pop + es

[R] Simple cat statement - output truncated

2009-07-15 Thread rkevinburton
I have a statement: cat("myforecast ETS(", paste(object$components[1], object$components[2], object$components[3], object$components[4], sep = ","), ") ", n, "\n") That generates: cast ETS( A,N,N,FALSE ) 3 Anyone guess as to why the first 5 letters are truncated/missing? Kevin

Re: [R] Grouping data in dataframe

2009-07-15 Thread John Kane
Another approach is to use the reshape package --Assuming your data.frame is called xx -- libarary(reshape) mm <- melt(xx, id=c("Size")) ; mm cast(mm, Size ~variable, median) -- --- On Tue, 7/14/09, Timo Schneider wrot

Re: [R] Simple cat statement - output truncated

2009-07-15 Thread Duncan Murdoch
On 7/15/2009 9:53 AM, rkevinbur...@charter.net wrote: I have a statement: cat("myforecast ETS(", paste(object$components[1], object$components[2], object$components[3], object$components[4], sep = ","), ") ", n, "\n") That generates: cast ETS( A,N,N,FALSE ) 3 Anyone guess as to why th

[R] Plotting hourly time-series data loaded from file using plot.ts

2009-07-15 Thread Keith
Hello everyone, I am just a tyro in R and would like your kindly help for some problems which I've been struggling for a while but still in vain. I have a time-series file (with some missing value ) which looks like time[sec] , Factor1 , Factor2 00:00:00 01.01.2007 , 0. , 0.176083 01:00:00 0

Re: [R] Matrix multiplication precision

2009-07-15 Thread Steve Lianoglou
Hi Douglas, And the big lesson, of course, is the first rule of numerical linear algebra., "Just because a formula is written in terms of the inverse of a matrix doesn't mean that is a good way to calculate the result; in fact, it is almost inevitably the worst way of calculating the result". Y

Re: [R] (simple) xml into data.frame and reverse

2009-07-15 Thread stefan.d...@gmail.com
Hi Duncan, thanks for the advice and the link. I just realized there is a mistake in the code I posted and I currently don't have the time to correct it. So I can not try your function (yet). But I will do so in the next few days and tell you if it doesnt work. Thanks again and best, Stefan On Wed

[R] Change data frame column names

2009-07-15 Thread Tom Liptrot
Hi R helpers, I have a data frame and I want to change the column names to names I have held in another data frame, but I am having difficulty. All data framnes are large so i can't input manually. Below is what i have tried so far: df<-data.frame(a=1:5, b=2:6, d=3:7, e=4:8) coltitles<-data

[R] Spaces in a name

2009-07-15 Thread Idgarad
I am reading regressors from an excel file (I have no control over the file) and some of the element names have spaces: i.e. "Small Bank Aquired" but I have found that lm(SourceData ~ . - "Small Bank Aquired", mcReg) doesn't work (mcReg = modelCurrentRegressors) As they are toggles I have ran th

Re: [R] Matrix multiplication precision

2009-07-15 Thread roger koenker
A good discussion of this is provided by Gill, Murray and Wright Num Lin Alg and Opt, section 4.7.2. url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-

Re: [R] predictive punishment module (was: Re: Simple cat statement - output truncated)

2009-07-15 Thread S Ellison
>>> Duncan Murdoch 15/07/2009 15:04:29 >>> >* R has a new predictive punishment module. It punishes you for things >it knows you will do later. Dang! Does that mean it'll return errors for the statistical idiocy I haven't yet got around to committing? ;-) Steve E **

Re: [R] Change data frame column names

2009-07-15 Thread Duncan Murdoch
On 7/15/2009 10:35 AM, Tom Liptrot wrote: Hi R helpers, I have a data frame and I want to change the column names to names I have held in another data frame, but I am having difficulty. All data framnes are large so i can't input manually. Below is what i have tried so far: df<-data.frame(

Re: [R] The greatest common divisor between more than two integers

2009-07-15 Thread Atte Tenkanen
Thanks! I try that. There is in some packege such a function. Atte > On Wed, Jul 15, 2009 at 8:55 AM, Atte Tenkanen wrote: > > > Do somebody know if there is a function in R which  computes the > greatest common divisor between several (more than two) integers? > > Is there a function for comp

Re: [R] Bug in package.skeleton, R 2.9.0?

2009-07-15 Thread Daniel Klevebring
Bump Anyone? Thanks Daniel On 13 jul 2009, at 10.57, Daniel Klevebring wrote: > Dear all, > > I am using package.skeleton to build a small packages of misc function > for personal use. I have recently discovered that the option > force=TRUE doesn't seem to do what is meant to do. Here's what I'

[R] Is it possible to use EGARCH and GJR in R?

2009-07-15 Thread Andriy Fetsun
Hi, Could you please help me with EGARCH and GJR? Is it possible to use EGARCH and GJR in R? I have used below mentioned code for GARCH in R, but I never used EGARCH and GJR in R. Thank you in advance! daten<-read.table("H://Daten//Zeitreihen//dax_1.csv", sep=";", header=T) DAX.ku

Re: [R] [R-sig-Geo] how to work with useFancyQuotes( ) to avoid \" quotes

2009-07-15 Thread Jaime R. Garcia Marquez
Try this: options(useFancyQuotes = F) print(paste("OPTIONS COORDSYS(", dQuote("Surface 1"), "AS COMPONENT);" ),quote=F) HTH, Jaime -R On Wed, 15 Jul 2009 13:15:32 +0200, Paulo E. Cardoso wrote: I need to get the exact sentence, with the quotes: OPTIONS COORDSYS("Surface1" AS COMPON

Re: [R] Nagelkerkes R2N

2009-07-15 Thread North, Bernard V
I am interested Andrea is whether you ever established why your R2 was 1. I have had a similar situation previously. My main issue though, which I'd be v grateful for advice on, is why I am obtaining such negative values -0.3 for Somers Dxy using validate.cph from the Design package given m

[R] Problems with computing an aggregated score

2009-07-15 Thread Hatsch
Hi all, I have a problem with computing a new variable as an aggregated score of other variables. Say, I have 10 variables for 1,000 observations (people). Every variable may have values between 0 and 8. What I would like to do is computing the mean of the individual top 3 values for every perso

[R] tkbutton and functions help

2009-07-15 Thread KO KE
Hey there, I’m quite lost in the R tcltk package and would love to get some help. My problem is this: Total_substes = 5 # example subcounter=1 # while the maximum number of subsets is not reached put buttons onto the tt widget while (subcounter <= total_subsets) {

[R] time series fiting and residual computing

2009-07-15 Thread Yogesh Tiwari
Dear 'R' Users, I have CO2 timeseries which I want to fit with fourth harmonic function and then would like to compute residuals. I tried with two option but not sure which one is correct, kindly any one can help correcting me: # #I would like to fit a model with Fourth harmonic function as: #m(

Re: [R] Change data frame column names

2009-07-15 Thread Duncan Murdoch
On 7/15/2009 10:35 AM, Tom Liptrot wrote: Hi R helpers, I have a data frame and I want to change the column names to names I have held in another data frame, but I am having difficulty. All data framnes are large so i can't input manually. Below is what i have tried so far: df<-data.frame(

Re: [R] problem with merging matrices

2009-07-15 Thread David Huffer
On Wednesday, July 15, 2009 8:28 AM, jurgen claesen wrote: > ...I'm a relative new user of R and I have a > problem with merging a collection of > matrices. All matrices in this collection > have the same dimension (532 rows and 532 > columns), but can differ in the row and

Re: [R] Plotting hourly time-series data loaded from file using plot.ts

2009-07-15 Thread Gabor Grothendieck
Try the zoo package: Lines <- "time[sec] , Factor1 , Factor2 00:00:00 01.01.2007 , 0. , 0.176083 01:00:00 01.01.2007 , 0. , 0.176417 11:00:00 10.06.2007 , 0. , 0.148250 12:00:00 10.06.2007 , NA , 0.147000 13:00:00 10.06.2007 , NA , 0.144417" library(zoo) library(chron) z <- read.zoo(t

Re: [R] Change data frame column names

2009-07-15 Thread Gavin Simpson
On Wed, 2009-07-15 at 14:35 +, Tom Liptrot wrote: > > > > Hi R helpers, > > I have a data frame and I want to change the column names to names I have > held in another data frame, but I am having difficulty. All data framnes are > large so i can't input manually. Below is what i have trie

Re: [R] Problems with computing an aggregated score

2009-07-15 Thread Mark Knecht
On Wed, Jul 15, 2009 at 3:37 AM, Hatsch wrote: > > Hi all, > > I have a problem with computing a new variable as an aggregated score of > other variables. > > Say, I have 10 variables for 1,000 observations (people). Every variable may > have values between 0 and 8. What I would like to do is compu

Re: [R] Change data frame column names

2009-07-15 Thread Don MacQueen
Try names(df) <- as.vector(unlist(coltitles)) This will fail if you have more than one row in your data frame coltitles. Which is why Duncan Murdoch's second email has a better solution. Given the difficulty in getting the titles out of the data frame in vector form, I would wonder why you're

Re: [R] Question related to merging zoo objects and apply function

2009-07-15 Thread Gabor Grothendieck
Please read the last line of every message to r-help. In particular simplify this as much as possible and construct some small artificial test data to illustrate. Anyways, func is probably not what you want. It has the same effect as func <- function(x, j) x[72+j] + [144+j] On Wed, Jul 15, 2009

Re: [R] Question related to merging zoo objects and apply function

2009-07-15 Thread Sergey Goriatchev
Hello, Gabor Generally, I follow the r-help rules and provide working code snippets to illustrate the problem. In this case it was more methodological question of how to loop names in merge() function. I solved this very simply buy renaming specific columns after I have ran merge(). Thank you for

Re: [R] Grouping data in dataframe

2009-07-15 Thread Timo Schneider
Am Mittwoch, den 15.07.2009, 00:42 -0500 schrieb markle...@verizon.net: Hi! > Hi: I think aggregate does what you want. you had 34 in one of your > columns but I think you meant it to be 33. > > DF <- read.table(textConnection("ExpA ExpB ExpC Size > 1 12 23 33 1 > 2 12 24 29 1 > 3 10 22 34 1 > 4

Re: [R] predictive punishment module (was: Re: Simple cat statem

2009-07-15 Thread Ted Harding
On 15-Jul-09 14:45:26, S Ellison wrote: > Duncan Murdoch 15/07/2009 15:04:29 >>> >> * R has a new predictive punishment module. It punishes you for >> things it knows you will do later. > Dang! Does that mean it'll return errors for the statistical idiocy > I haven't yet got around to commi

Re: [R] Problems with computing an aggregated score

2009-07-15 Thread Jorge Ivan Velez
Dear Johannes, If 'x' is your data set, here is one way using apply: res <- apply(x[,-1], 1, function(x){ xo <- sort(x, decreasing = TRUE) mean(xo[1:3]) } ) names(res) <- x[,1] res # ABC # 5.67 5.00 5.3

[R] negative Somers D from Design package

2009-07-15 Thread North, Bernard V
Dear R help My problem is very similar to the analysis detailed here. If we use the mayo dataset provided with the survivalROC package the estimate for Somer's Dxy is very negative -0.56. The Nagelkerke R2 is positive though 0.32. I know there is a difference between explained variation and predi

[R] For loop for distinguishing negative numbers

2009-07-15 Thread cmga20
Hi i am very new to R and I have been trying to change each individual piece of data in a data set to 10 if it is below 0 and 5 if it is above 0. I know this sounds very easy but i am struggling!! -- View this message in context: http://www.nabble.com/For-loop-for-distinguishing-negative-numbers

Re: [R] nls, reach limit bounds

2009-07-15 Thread Bert Gunter
... and getting an answer is no assurance that the answer is meaningful. In cases like this (which arise frequently because of insistence on using the accepted mechanistic model paradigm even in the absence of informative data to estimate it), the confidence intervals for (correlated) parameters wi

Re: [R] For loop for distinguishing negative numbers

2009-07-15 Thread tonybreyal
see ?ifelse you didn't specify what happens if a value is exactly zero in the dataset and so i've just bundled it in with the negative case: x <- rnorm(20, 0, 1) y<-ifelse(x<=0, 10, 5) HTH, Tony Breyal cmga20 wrote: > > Hi i am very new to R and I have been trying to change each individual

Re: [R] Simulation functions for underdispered Poisson and binomial distributions

2009-07-15 Thread Charles C. Berry
On Wed, 15 Jul 2009, Shinichi Nakagawa wrote: Dear R users I would like to simulate underdispersed Poisson and binomial distributions somehow. I know you can do this for overdispersed counterparts - using rnbinom() for Poisson and rbetabinom() for binomial. Could anyone share functions to

Re: [R] Matrix multiplication precision

2009-07-15 Thread Nair, Murlidharan T
Thanks for the explanation. I am not too deep into linear algebra. T.mat, Rz.mat and Q.mat are square matrices 4 x 4. To be more clear, here is what they look like. h=3.39/2; T.mat<-matrix(c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-h,1), nrow=4) # translation of the system alpha<-36*pi/180 cos.alpha<-c

Re: [R] (newbie) sum for certain number of rows

2009-07-15 Thread kelvin lau
Thanks. I tried it and it worked wonderful. Wishing for the "DAY' to come. Life needs to be 'reset'. --- On Wed, 7/15/09, Dimitris Rizopoulos wrote: > From: Dimitris Rizopoulos > Subject: Re: [R] (newbie) sum for certain number of rows > To: "kelvin lau" > Cc: r-help@r-project.org > Date:

Re: [R] read.delim skips first column (why?)

2009-07-15 Thread Paolo Sonego
This should work: junk <-read.table("fd0edfab.txt", sep="", header=T, fill=F,quote=" ") HIH Paolo Sonego __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/post

[R] Passing additional arguments through '...'

2009-07-15 Thread escher2079
Hi, I know this is a simple question, but I've been having problems passing additional arguments through '...'. It is not matching the arguments correctly if the permanent argument of the function begins with the same letter as the additional argument. The following example will help show what I

[R] FW: problems in resampling time series, block length, trend.test

2009-07-15 Thread Simone Santoro
Hi, I have a time series (say "x") of 13 years showing an evident increase. I want to exclude two observations (the fourth and 10th), so I do: > trend.test(x[-c(4,10)]) where: > x[-c(4,10)] [1]7 37 79 72 197 385 636 705 700 1500 1900 and I get: Spearman's rank corre

Re: [R] Bug in package.skeleton, R 2.9.0?

2009-07-15 Thread ml-r-help
Daniel Klevebring wrote: > Bump > > Anyone? > > Thanks > Daniel > > On 13 jul 2009, at 10.57, Daniel Klevebring wrote: > >> Dear all, >> >> I am using package.skeleton to build a small packages of misc function >> for personal use. I have recently discovered that the option >> force=TRUE doesn'

Re: [R] Passing additional arguments through '...'

2009-07-15 Thread Bert Gunter
Please consult the R Language Definition for a detailed explantion, but... In brief, the evaluator first tries to match formal arguments by name, first exactly, then partially, before matching by position, so "a" partially matches formal argument "abc". e.g. contrast > fun.tester(0,b=1) ## "b" d

Re: [R] Is it possible to use EGARCH and GJR in R?

2009-07-15 Thread Liviu Andronic
Hello, On 7/15/09, Andriy Fetsun wrote: > Could you please help me with EGARCH and GJR? > Do you mean JGR [1]? If so, install it and try running your code in it. Unless you bump into very specific issues, it should work. Liviu [1] http://cran.r-project.org/web/packages/JGR/index.html

Re: [R] Change data frame column names

2009-07-15 Thread Tom Liptrot
Thanks all, I used Gavins approach - unlisting the titles and the replacing names, as my titles were stored as factors in the data frame as that was the way they were imported... Tom > Subject: Re: [R] Change data frame column names > From: gavin.simp...@ucl.ac.uk > To: tomlipt...@hotmail.co

Re: [R] negative Somers D from Design package

2009-07-15 Thread Frank E Harrell Jr
For the Cox model Dxy is the rank correlation between predicted log hazard and time to event. As a high hazard means that the time to event is short, you need to negate Dxy for your purpose. Frank North, Bernard V wrote: Dear R help My problem is very similar to the analysis detailed here.

Re: [R] Passing additional arguments through '...'

2009-07-15 Thread Charles C. Berry
On Wed, 15 Jul 2009, escher2079 wrote: Hi, I know this is a simple question, but I've been having problems passing additional arguments through '...'. It is not matching the arguments correctly if the permanent argument of the function begins with the same letter as the additional argument. Th

[R] spreadsheet-style autoupdating

2009-07-15 Thread Liviu Andronic
Dear all, I am curious whether one can automatically update, say, a column in R, similar to how spreadsheets (Excel, etc.) do? In my specific case I have two columns with logical data, which individually convey different information, although ultimately for a common purpose (flagging for removal).

[R] Help with averaging

2009-07-15 Thread Amit Patel
Hi I am using the following script to average a set of data 0f 62 columns into 31 colums. The data consists of values of ln(0.01) or -4.60517 instead of NA's. These need to be averaged for each row (i.e 2 values being averaged). What I would I need to change for me to meet the conditions: 1.

[R] searching for elements

2009-07-15 Thread Chyden Finance
Hello! For the past three years, I have been using R extensively in my PhD program in Finance for statistical work. Normally, I can figure this kind of thing out on my own, but I am completely stumped as to why the following code does not work. I have two variables: sigs and p0_recent.

[R] Differing Variable Length Inconsistencies in Random Effects/Regression Models

2009-07-15 Thread A Singh
Dear All, I am quite new to R and am having a problem trying to run a linear model with random effects/ a regression- with particular regard to my variable lengths being different and the models refusing to compute any further. The codes I have been using are as follows: vc<-read.table("P:\

Re: [R] searching for elements

2009-07-15 Thread Steve Lianoglou
Hi, On Jul 15, 2009, at 1:00 PM, Chyden Finance wrote: Hello! For the past three years, I have been using R extensively in my PhD program in Finance for statistical work. Normally, I can figure this kind of thing out on my own, but I am completely stumped as to why the following code do

Re: [R] Spaces in a name

2009-07-15 Thread Allan Engelhardt
Not sure how to get formula to handle spaces, but to get going you can just change the names in the data frame after you have read it, e.g. names(mcReg) <- make.names(names(mcReg)) will (usually) give you Small.Bank.Acquired. Allan On 15/07/09 15:40, Idgarad wrote: > I am reading regressors fr

Re: [R] searching for elements

2009-07-15 Thread Steve Lianoglou
One more thing, Error in Ops.factor(sigs[i, 1], p0_recent[j, 1]) : level sets of factors are different It seems that this particular problem is due to the fact that you are comparing two sets of factors with different levels, which is what the Ops.factor error is saying. But let's make it

[R] RODBC results from stored procedure

2009-07-15 Thread tradenet
Short of uploading a SQL server database, I don't think I can make this example reproducible, but I hope it's not so complicated as to require reproducibility I'm using RODBC to get data from Microsoft SQL Server. I can call a parametrized stored procedure without a problem and the proc does

[R] duplicate data points on a line graph

2009-07-15 Thread NDC/jshipman
Hi, I am new to R plot. I am trying to increase the data point observation when duplicate data points exist x y 1 10 1 10 2 3 4 5 9 8 in the about example 1, 10 would be displayed larger than the other data points. Could someone give me some assistan

Re: [R] duplicate data points on a line graph

2009-07-15 Thread Dieter Menne
LARC/J.L.Shipman/jshipman wrote: > > I am new to R plot. I am trying to increase the data point > observation when duplicate data points exist > > x y > 1 10 > 1 10 > 2 3 > 4 5 > 9 8 > > in the about example 1, 10 would be displayed larger than the other >

Re: [R] duplicate data points on a line graph

2009-07-15 Thread Chuck Cleland
On 7/15/2009 2:19 PM, NDC/jshipman wrote: > Hi, > I am new to R plot. I am trying to increase the data point > observation when duplicate data points exist > > xy > 110 > 110 > 23 > 45 > 9 8 > > > in the about example 1, 10 would be displayed larger than the other >

Re: [R] Spaces in a name

2009-07-15 Thread Gabor Grothendieck
Try this with built in BOD: > names(BOD) <- paste(names(BOD), "X") > BOD Time X demand X 1 1 8.3 2 2 10.3 3 3 19.0 4 4 16.0 5 5 15.6 6 7 19.8 > lm(`demand X` ~ `Time X`, BOD) Call: lm(formula = `demand X` ~ `Time X`, data = BOD) Coefficien

Re: [R] duplicate data points on a line graph

2009-07-15 Thread baptiste auguie
Alternatively, you could make use of transparency (on some devices), or use ggplot2 to map the number of observations to the point size, d = read.table(textConnection(" x y 1 10 1 10 2 3 4 5 9 8 "),head=T) library(ggplot2) # transparency qplot(x, y, data=d, al

Re: [R] RODBC results from stored procedure

2009-07-15 Thread Dieter Menne
tradenet wrote: > > Short of uploading a SQL server database, I don't think I can make this > example reproducible, but I hope it's not so complicated as to require > reproducibility > > I can call a parametrized stored procedure without a problem and the proc > does indeed execute success

[R] GLM Gamma Family logLik formula?

2009-07-15 Thread Skipper Seabold
Hello all, I was wondering if someone can enlighten me as to the difference between the logLik in R vis-a-vis Stata for a GLM model with the gamma family. Stata calculates the loglikelihood of the model as (in R notation) some equivalent function of -1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+l

[R] strategy to iterate over repeated measures/longitudinal data

2009-07-15 Thread Juliet Hannah
Hi Group, Create some example data. set.seed(1) wide_data <- data.frame( id=c(1:10), predictor1 = sample(c("a","b"),10,replace=TRUE), predictor2 = sample(c("a","b"),10,replace=TRUE), predictor3 = sample(c("a","b"),10,replace=TRUE), measurement1=rnorm(10), measurement2=rnorm

[R] storing lm() results and other objects in a list

2009-07-15 Thread Idgarad
to clean up some code I would like to make a list of arbitrary length to store various objects for use in a loop sample code: BEGIN SAMPLE ## # You can see the need for a loop already linearModel1=lm(modelSource ~ .,mcReg) linearModel2=step(linearModel1) linearModel3=lm(

Re: [R] spreadsheet-style autoupdating

2009-07-15 Thread Liviu Andronic
Hello Patrick, On 7/15/09, Patrick Burns wrote: > How about something along the lines of: > apply(twocolumns, 1, any) > This efficiently solves the first part of my question. I will probably content myself with issuing this command each time I update one of the "twocolumns"; I'm still curious wh

Re: [R] problem with merging matrices

2009-07-15 Thread David Huffer
Jurgen, I obviously didn't read the text of yours that I quoted (viz., "and that in case of a match between the row or column names the smallest value is retained"). My apologies. David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On B

Re: [R] plotting confidence intervals

2009-07-15 Thread Greg Snow
I believe there is a set of options in the ggplot2 package that will create a plot and add the confidence region to it, you will need to look at the documentation for ggplot2, I don't know the details (have not made it that far on my to do list, not anything against the package). -- Gregory (G

[R] Question regarding package submission to CRAN

2009-07-15 Thread Gates, Michael
**Please Note: Email below was bounced back (rejected by the Packages email list moderator), so please do not ask me to submit to r-packa...@r-project.org. Members, I recently submitted my first package to the submissions ftp site on CRAN (7.3.09). The package

  1   2   >