[R] how to get means and confidence limits after glmmPQL or lmer

2009-07-15 Thread Don Driscoll
R, I want to get means and confidence limits on the original scale for the treatment effect after running a mixed model. The data are: response<-c(16,4,5,8,41,45,10,15,11,3,1,64,41,23,18,16,10,22,2,3) block<-factor(c("A","A","A","A","I","I","I","I","N","N","N","P","P","P","P","P","P","S","S"

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

2009-07-15 Thread Dieter Menne
Idgarad wrote: > > > ... Very long non-self-contained code removed > > Suggestions on how to handle the whole linearModel and the child data? > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do rea

Re: [R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-15 Thread Gabor Grothendieck
Here is a variation on the solution below (first line is the same but second differs): > ind <- which(a == 0, arr = TRUE) > mapply("[", dimnames(a), as.data.frame(ind)) [,1] [,2] [1,] "A1" "F1" [2,] "A3" "F1" [3,] "A2" "F2" [4,] "A3" "F3" On Thu, Jul 16, 2009 at 12:40 AM, Jorge Ivan Velez w

[R] error for installation

2009-07-15 Thread jlfmssm
I used packages 'fields". when I load workspace again, then do installation again. I get the following error. I read R for Windows FAQ (4.8 see below), but I still can't figure it out. Does anyone can help me out? Thanks, jlm > install.packages("fields",repos="http://streaming.stat.iastate.ed

Re: [R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-15 Thread Jorge Ivan Velez
Dear Alberto, Try this: # colnames and rownames cn <- colnames(a) rn <- rownames(a) # the index ind <- which(a==0, arr = TRUE) # the result data.frame( res = apply(ind, 1, function(x) paste(rn[x[1]],",", cn[x[2]], sep ="") )

Re: [R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-15 Thread David Winsemius
On Jul 15, 2009, at 7:15 PM, Alberto Lora M wrote: Dear sir, I have a matrix like a<-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)<-c("F1","F2","F3") rownames(a)<-c("A1","A2","A3") a F1 F2 F3 A1 0 4 5 A2 2 0 8 A3 0 6 0 I want to extract all pairs (rownames, columnames) from whi

[R] Question on importing large dataset (1.4GB) into R-Bioconductor

2009-07-15 Thread Anqi
To whom it may concern, I am a student from Peking University, China. I am currently doing some microarray data analysis research with Bioconductor package of R. Problem arises when I try to import into R my dataset which contains 109 samples (total size more than 1.4 GB). The memory limit o

Re: [R] Problem using strptime

2009-07-15 Thread Gabor Grothendieck
Check out: http://article.gmane.org/gmane.comp.lang.r.general/155702 On Wed, Jul 15, 2009 at 11:45 PM, Alon Ben-Ari wrote: > Hello > I am trying to read a date and time from a file and convert them to POSIXct > using strptime() > the dates are stored in t which is a factor > This the code I am us

[R] Problem using strptime

2009-07-15 Thread Alon Ben-Ari
Hello I am trying to read a date and time from a file and convert them to POSIXct using strptime() the dates are stored in t which is a factor This the code I am using to illustarte > t[1] [1] 07/14/2009 13:41:00 10 Levels: 07/14/2009 13:41:00 07/14/2009 13:42:00 ... 07/15/2009 07:12:00 > a=t[1]

Re: [R] evaluate sum of sum

2009-07-15 Thread Rolf Turner
On 16/07/2009, at 2:30 PM, Roslina Zakaria wrote: Hi R-users, Could anybody show me how to write a code to evaluate sum(z[i] + sum (k[j]*(z[i])^(k[j])), i=1 to 4, j=0 to infinity) ? No. No-one can. It is conceptually impossible. (a) Computers cannot do infinite sums; they can only do fin

Re: [R] Count the number of occurences in ranges

2009-07-15 Thread Jorge Ivan Velez
Dear torpedo, Take a lookat ?cut and its examples. HTH, Jorge On Wed, Jul 15, 2009 at 11:26 PM, torpedo fisken wrote: > I got a vector of probabilities like, > probs<-c(0.001,0.5,0.02,1,.) > > Is there any nice and easy builtin function to get the number of > occurences within some specifi

[R] Count the number of occurences in ranges

2009-07-15 Thread torpedo fisken
I got a vector of probabilities like, probs<-c(0.001,0.5,0.02,1,.) Is there any nice and easy builtin function to get the number of occurences within some specified probabality range. Like with 2% it would be occur[1] = sum(probs[probs>0&probs<0.02]) occur[2] = sum(probs[probs>0.02&probs<0.04

[R] how to group the output of aov by a variable?

2009-07-15 Thread Ayelet Landau
Hi there, I am new to R and have what seems to be a simple question. I put together the following commands in order to run an anova on multiple different variables at once: for(i in 10:20) {subj <- mydata[ which(lupi2$subject=='mas'),] cat("ANOVA for variable:", names(subj[i])) pri

[R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-15 Thread Alberto Lora M
Dear sir, I have a matrix like a<-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)<-c("F1","F2","F3") rownames(a)<-c("A1","A2","A3") a F1 F2 F3 A1 0 4 5 A2 2 0 8 A3 0 6 0 I want to extract all pairs (rownames, columnames) from which the value in the matrix is 0 The result should be

[R] Help with RODBC connection to multiple MS SQL Sever databases

2009-07-15 Thread Chris Anderson
I'm trying to pull data from multiple MS SQL Sever databse in R. I can access the databases one at a time, but the tables are to large to pull the entire tables then join then in R. So I need to do a SQL join that will join the tables from the each of the databases. How do I combine the connecti

Re: [R] abline(v= x) in plot with time formated xaxis not working

2009-07-15 Thread David Winsemius
On Jul 15, 2009, at 5:25 PM, F!! wrote: Hi, I try to create a vertical line in my plot, which has a xaxis comprising time formated data. This is what I tried: y<-152833 x<-strptime(y, format="%H%M%S") abline(v=x, col="red") But, but, but ... where is your plot functi

[R] evaluate sum of sum

2009-07-15 Thread Roslina Zakaria
Hi R-users, Could anybody show me how to write a code to evaluate sum(z[i] + sum(k[j]*(z[i])^(k[j])), i=1 to 4, j=0 to infinity) ? Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mail

[R] duplicate data points on a line graph

2009-07-15 Thread Carl Witthoft
If you want to take the second approach, it can be relatively easily generalized by calculating the cex values based on the count of ordered pairs in the original dataset. Here's a data set: > xy x y [1,] 1 4 [2,] 1 5 [3,] 2 3 [4,] 3 3 [5,] 4 5 [6,] 5 2 [7,] 1 4 [8,] 2 3 Here's the same

Re: [R] GLM Gamma Family logLik formula?

2009-07-15 Thread Skipper Seabold
On Wed, Jul 15, 2009 at 8:45 PM, Ben Bolker wrote: > > > > jseabold wrote: >> >> 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 mod

Re: [R] GLM Gamma Family logLik formula?

2009-07-15 Thread Ben Bolker
jseabold wrote: > > 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/s

[R] axis label config mgp

2009-07-15 Thread Marlin Keith Cox
I have long axis labels (8units) on the x axis and 2 unit number labels on the y axis. I need to move the x axis title without moving the y axis title. I have used mgp=c(title, label and line), but mgp moves both the x and y titles. The following puts the y axis title way way out to the left. An

Re: [R] Axes origins and labeling

2009-07-15 Thread S Ellison
Since you;re already specifying the axis tick locations for the x-axis any ylim for y, one way of dealing with it is to give the axes an extra tick at each end: Instead of axis(side=1, at=c(1,2,3,4), labels=gut) use axis(side=1, at=0:5, labels=gut) Similarly for axis(2), use axis(2, at=seq(0,250,

Re: [R] searching for elements

2009-07-15 Thread Moshe Olshansky
?outer --- On Thu, 16/7/09, Chyden Finance wrote: > From: Chyden Finance > Subject: [R] searching for elements > To: r-help@r-project.org > Received: Thursday, 16 July, 2009, 3:00 AM > Hello! > > For the past three years, I have been using R extensively > in my PhD program in Finance for stat

[R] abline(v= x) in plot with time formated xaxis not working

2009-07-15 Thread F!!
Hi, I try to create a vertical line in my plot, which has a xaxis comprising time formated data. This is what I tried: y<-152833 x<-strptime(y, format="%H%M%S") abline(v=x, col="red") for some reason, it doesn't work and no error msg is displayed... I hope

[R] Select set of variables with strongest correlation

2009-07-15 Thread nyk
What would be a good method to find the subset of columns of a data matrix (with about 200 rows and columns) that has the strongest correlation to one other column? I tried testing sub-matrices with random sets of 10 columns selected using lm(x ~submtrx) and comparing the r^2 values. But isn't the

Re: [R] Substituting a user-defined function for a standard function in graphics

2009-07-15 Thread Duncan Murdoch
On 15/07/2009 4:25 PM, John Kolassa wrote: Dear R-help readers, I'm trying to substitute my own version of plot.default, in order to capture low-level graphics input for further manipulation. I seem to be having difficulties getting the versions of functions that I intend to use called at t

Re: [R] Simulation code error

2009-07-15 Thread Roger Bivand
This message is one of a number of identical copies, also cross-posted to R-sig-geo, and in fact with an obvious solution that the author gives at the end. The thread will be continued on R-sig-geo. Cross posting is advised against expressly in e.g. http://en.wikipedia.org/wiki/Crossposting, and

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

2009-07-15 Thread Mark Difford
Perhaps I should have added the following: To see that it "works," run the following: famfit<-lmer(peg.no~1 + (1|family), na.action=na.exclude, vcdf) resfam<-residuals(famfit) for( i in 1:length(colms)) { print(coef(lm(resfam~colms[,i]))) } Regards, Mark. A Singh wrote: > > > Dear All, >

Re: [R] spreadsheet-style autoupdating

2009-07-15 Thread Charles C. Berry
On Wed, 15 Jul 2009, Liviu Andronic wrote: 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 on

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

2009-07-15 Thread Guazzelli, Alex
Hi Allan, Thanks a lot for your reply. I am glad you are an advocate for PMML. I found PMML in 2004 and was fascinated by the idea of representing my models in a standard language that can actually be moved around different platforms. PMML started small, but is now a mature standard. The

[R] Simulation code error

2009-07-15 Thread Steve Hong
Dear List, I have some problem with my simulation code. Here is output from R: > sim.sp <- function(data,CM,n,N) + { + C <- matrix(rep(NA,N),ncol=1) + for(i in 1:N) + { + j <- n + xx <- which(colSums(CM[j,])==1) + V <- names(xx) + V <- paste(V, collapse="+") + V <- paste("SBA~", V) + rd <- round

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

2009-07-15 Thread Mark Difford
Hi Aditi, Parts of _your_ code for the solution offered by Jerome Goudet are wrong; see my comments. > famfit<-lmer(peg.no~1 + (1|family), na.action=na.omit, vcdf) ## use: > na.action=na.exclude > resfam<-residuals(famfit) > for( i in 1:length(colms)) + { + print ("Marker", i) + regfam<-ab

Re: [R] Comprehensive power analysis/sample size package in R?

2009-07-15 Thread Tobias Verbeke
Frank E Harrell Jr wrote: Greg Snow wrote: I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations. For the simple cases you already found the pwr package, there are also some power f

Re: [R] Substituting a user-defined function for a standard function in graphics

2009-07-15 Thread David Winsemius
On Jul 15, 2009, at 4:25 PM, John Kolassa wrote: Dear R-help readers, I'm trying to substitute my own version of plot.default, in order to capture low-level graphics input for further manipulation. I seem to be having difficulties getting the versions of functions that I intend to us

Re: [R] Comprehensive power analysis/sample size package in R?

2009-07-15 Thread Mitchell Maltenfort
It's not R nor is it open source, but G*Power 3 is free: http://www.psycho.uni-duesseldorf.de/abteilungen/aap/gpower3/ Apparently the new version (for Windows -- Mac version is lagging) includes Poisson and logistic regression. On Tue, Jul 14, 2009 at 3:04 PM, wrote: > Dear all, > my colleag

Re: [R] Axes origins and labeling

2009-07-15 Thread Greg Snow
Look at the box function, or use xaxt='n' and/or yaxt='n' rather than axes=FALSE. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] Comprehensive power analysis/sample size package in R?

2009-07-15 Thread Frank E Harrell Jr
Greg Snow wrote: I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations. For the simple cases you already found the pwr package, there are also some power functions in the stats packa

Re: [R] FW: Package submission to CRAN

2009-07-15 Thread Dirk Eddelbuettel
On 15 July 2009 at 13:34, Gates, Michael wrote: | 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

Re: [R] Comprehensive power analysis/sample size package in R?

2009-07-15 Thread Greg Snow
I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations. For the simple cases you already found the pwr package, there are also some power functions in the stats package and in some othe

[R] Error in simulation R-code

2009-07-15 Thread Steve Hong
Dear List, I have got error message when I run the R-code. I guess this happened when observation(s) has no neighborhood at specified distance. Is there any way/R-code to ignore one without neighborhood and proceed the simulation? v.code <- df.bm7[,c(10:31)]; v.code[1:3,] names(v.code) CM = v.co

[R] Axes origins and labeling

2009-07-15 Thread Marlin Keith Cox
I have re-labeled tick marks on the x axis. The problem is that by using axes=FALSE, the axes disappears and when they are called back using axis(side=1)..etc. the axis on sides 1 and 2 do not meet at the bottom left corner of the graph. I would also like to have the 3rd and 4th axes in there as

[R] Substituting a user-defined function for a standard function in graphics

2009-07-15 Thread John Kolassa
Dear R-help readers, I'm trying to substitute my own version of plot.default, in order to capture low-level graphics input for further manipulation. I seem to be having difficulties getting the versions of functions that I intend to use called at the right places. Specifically, I have a

[R] FW: 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 ha

Re: [R] Help with averaging

2009-07-15 Thread David Winsemius
You might want to look at the help page for: ?mean and pay close attention to the na.rm= argument/ On Jul 15, 2009, at 12:51 PM, Amit Patel wrote: 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.6051

[R] Error in simulation R-code

2009-07-15 Thread Steve Hong
Dear List, I have got error message when I run the R-code. Can anyone has a suggestion? v.code <- df.bm7[,c(10:31)]; v.code[1:3,] names(v.code) CM = v.code # variable binomial code sim.sp <- function(data,CM,n,N) { C <- matrix(rep(NA,N),ncol=1) for(i in 1:N) { j <- n x

Re: [R] Proper Paste for Data Member

2009-07-15 Thread Greg Snow
The dollar sign ($) is a magical shortcut for the [[ subset operator (yes the doubling is intentional) for accessing parts of lists/data frames/etc. When you try to use magical shortcuts for purposes beyond what they were designed for, you get the computer equivalent of turning yourself into a

[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

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

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] 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

[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(

[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] 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

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

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] 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 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] 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 >

[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

[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

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

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
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

[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:\

[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] 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] 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).

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

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] 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] 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] 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] 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'

[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

[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

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

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] 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] 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] 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] 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

[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

[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

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

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] 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] 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] 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] 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] 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 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] 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] 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] 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(

[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(

[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] 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

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

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

[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

  1   2   >