Re: [R] Multiple plots with one legend

2011-03-27 Thread mavkoup
Yes that's what I had managed to generate too. I can produce my 3 plots. Each plot has 10 colored lines say. I want to place the legend in the 4th spot listing the name of the 10 colored lines, and their color. -- View this message in context:

[R] Bootstrap 95% confidence intervals for splines

2011-03-27 Thread mitchell wachtel
There appear to be reports in the literature that transform continuous independent variablea by the use of splines, e.g., assume the dependent variable is hot dogs eaten per week (HD) and the independent variable is waistline (WL), a normal linear regression model would be:

[R] Garchoxfit package

2011-03-27 Thread Ning Cheng
Dear List, I'm now using Ubuntu 10.10 and I want to use the garchoxfit function.It seems that I need to download the package. While after installing the package,I still can't use the garchoxfit function.What's the reason and how to fix that? Thanks for your time! Best, Ning

[R] run function on subsets of matrix

2011-03-27 Thread fisken
I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I want to do this on subrows of the matrix, given by some vector(same length as the the number of rows). Something like nObs- 6 nDim - 4 m -

Re: [R] Garchoxfit package

2011-03-27 Thread David Winsemius
On Mar 26, 2011, at 11:16 PM, Ning Cheng wrote: Dear List, I'm now using Ubuntu 10.10 and I want to use the garchoxfit function.It seems that I need to download the package. While after installing the package,I still can't use the garchoxfit function.What's the reason and how to fix that? A

Re: [R] run function on subsets of matrix

2011-03-27 Thread David Winsemius
On Mar 26, 2011, at 10:26 PM, fisken wrote: I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I want to do this on subrows of the matrix, given by some vector(same length as the the number of rows).

Re: [R] run function on subsets of matrix

2011-03-27 Thread peter dalgaard
On Mar 27, 2011, at 08:25 , David Winsemius wrote: On Mar 26, 2011, at 10:26 PM, fisken wrote: I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I want _along_ the columns, I assume. to do this on

[R] Hmisc summary.formula formats for binary and continuous variables

2011-03-27 Thread Kwok, Heemun
Hello, I am using Hmisc summary.formula, latex and Sweave to produce tables for publication. Is it possible to change the formats for binary and continuous variables? I would prefer to show 35 (10%) and 1.5 (1.2-1.8) rather than 10% (35) and 1.2 / 1.5 / 1.8. Here is a simple example: sex -

Re: [R] Hmisc summary.formula formats for binary and continuous variables

2011-03-27 Thread Joshua Wiley
I played around with this for awhile and did not get very far. I did not see any arguments in summary.formula or its print methods to reorder (happy to be corrected). Another approach I toyed with was to create a custom function to pass to summary.formula() that would itself create (something

Re: [R] Multiple plots with one legend

2011-03-27 Thread jim holtman
Here is how to do the legend: x - cbind(rbind(1,2,3), 4) layout(x, width = c(5,1)) layout.show(4) plot(1:10, type = 'l') plot(1:10, type = 'l') plot(1:10, type = 'l') # reset margins for creating the legend oldMar - par(mar = c(0,0,0,0)) plot.new() legend('center' , legend = 1:10 , lwd =

Re: [R] run function on subsets of matrix

2011-03-27 Thread David Winsemius
On Mar 27, 2011, at 3:22 AM, peter dalgaard wrote: On Mar 27, 2011, at 08:25 , David Winsemius wrote: On Mar 26, 2011, at 10:26 PM, fisken wrote: I was wondering if it is possible to do the following in a smarter way. I want get the mean value across the columns of a matrix, but I

Re: [R] A question on glmnet analysis

2011-03-27 Thread 細田弘吉
(11/03/25 22:40), Nick Sabbe wrote: 2. Which model, I mean lasso or elastic net, should be selected? and why? Both models chose the same variables but different coefficient values. You may want to read 'the elements of statistical learning' to find some info on the advantages of

Re: [R] About proportional odds ratio model with LASSO in ordinal regression

2011-03-27 Thread Juliet Hannah
If you can work with a different penalty check out the lrm function from the rms package, which uses penalized likelihood to fit proportional odds. 2011/3/24 Jheng-Jhong Wang iiamba...@gmail.com: Dear R-users,         I try to fit proportional odds ratio model with LASSO in ordinal

[R] model diagnostics for MatrixModels

2011-03-27 Thread Carson Farmer
Dear list, I have been working with the MatrixModels package quite a bit this week, and it is proving to be extremely valuable for my current work (I am working with several factors with many levels, leading to a sparse model matrix). However, as my knowledge of statistical theory leaves much to

Re: [R] line graph question

2011-03-27 Thread Jim Holtman
?axis Sent from my iPad On Mar 26, 2011, at 18:21, Bulent Arikan bulent.ari...@gmail.com wrote: Hi, I am working on some line charts and although I have a lot of resources, I cannot seem to find an answer to this question: how can I set the incrementation of values on the x-axis values so

Re: [R] Bootstrap 95% confidence intervals for splines

2011-03-27 Thread Tim Hesterberg
You're mixing up two concepts here, - splines - bootstrap confidence intervals Separating them may help cut the confusion. First, to do a bootstrap confidence interval for a difference in predictions in the linear regression case, do: repeat 10^4 times draw a bootstrap sample of the

Re: [R] bwplot [lattice]: how to get different y-axis scales for each row?

2011-03-27 Thread Marius Hofert
Dear expeRts, I partially managed to obtain what I wanted by using latticeExtra. However, the following questions remain: 1) why do not all x-axis labels appear? [compare bw and bw2] 2) Can I have the y-axis labels on the right margin/side of the plot? Changing the alternating argument does not

[R] (no subject)

2011-03-27 Thread filame uyaco
http://dix4life.leadhoster.com/molo.php [[alternative HTML version deleted]] __ 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/posting-guide.html

[R] Asking Favor For the Script of Median Filter

2011-03-27 Thread chuan_zl
Hello,everybody. My name is Chuan Zun Liang. I come from Malaysia. I am just a beginner for R. Kindly to ask favor about median filter. The problem I facing as below: x-matrix(sample(1:30,25),5,5) x [,1] [,2] [,3] [,4] [,5] [1,]78 30 29 13 [2,]46 1259 [3,]

[R] Problem with R, MKL, and Ubuntu 11.04

2011-03-27 Thread Yan Zhou
This may not be a proper question to ask here, however I don't find a better place to ask. I am testing Ubuntu Natty 11.04. I build R with Blas/Lapack linked to intel MKL. Everything works fine but when quitting R with q(), the R process won't quit, and the system monitor shows its waiting

[R] gtk, RGtk2 and error in callback: delet_event in mai window

2011-03-27 Thread Cleber N. Borges
Hello All, I am trying to learn about the GUI in R (with GTK+Glade+RGtk2) and in my test I don't get sucess in to make an callback to destroy the application... When I try to define an function for delet-event callback, I get the error message: (with mouse click in X window) *Error in

[R] R Help

2011-03-27 Thread Yadavalli, Anita P
Hi, Creating the X'y vector has been troublesome. I get the error: requires numeric/complex matrix/vector arguments. Could you please look at my code and tell me what I am doing wrong? I have several dummy variables among my independent variables. #Variable MHL16, or that corresponding to

[R] Help labeling Panels

2011-03-27 Thread MTHarden
Hi, I'm new. I tried to search out this answer but I suspect I was using the wrong terms, or simply not understanding some of the answers. Anyway here is my question: I want to have a 2x2 panel figure with 4 line graphs all in the same scale. Actually I have that. The thing I seem to be lacking

[R] pmt

2011-03-27 Thread statfan
I am working with the pmt function in the {mnormt} package, and i am getting negative values returned. the following is an example of one of my outputs: pmt(x = c(3.024960, -1.010898), mean = c(21.18844, 21.18844), S = matrix(c(.319,.139,.139,0.319), 2, 2),df = 42) # -6.585641e-18 Any help on

[R] Sweave: include a multi-page-pdf plot

2011-03-27 Thread Alexander Engelhardt
Hi, I'm just starting out with Sweave, and I can't get a plot(linmod) to display all four plots: bild = x1 - runif(100) x2 - rexp(100) y - 3 + 4*x1 + 5*x2 + rnorm(100) mod - lm(y~x1+x2) plot(mod) @ Some Text fig=TRUE= bild @ This plots only the first image of the four-page plot.lm()

Re: [R] Hmisc summary.formula formats for binary and continuous variables

2011-03-27 Thread Frank Harrell
If by 35 (10%) you mean that 35 is the numerator, this is not such a good idea. That's because it emphasizes something that is not a scientific quantity. A scientific quantity is something that has a meaning outside the current sample. The numerator is dependent on the denominator. Regarding

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread Mike Marchywka
( sorry if this is a duplicate, I am not sure if hotmail is dropping some of my posts. Thanks ) You obviously want to delegate inner loops to R packages that execute as native, hopefully optimized, code. Generally a google search that starts with R CRAN will help. In this case it looks

Re: [R] R Help

2011-03-27 Thread John Kane
Hi Anita, A bit of sample data would probably help here. Have a look at ?dput for a handy way to supply some data. Also a quick summary of exactly what you are trying to accomplish would be useful. A very cursory reading of the program leaves one wondering why you are creating all those

Re: [R] pmt

2011-03-27 Thread Ravi Varadhan
That is essentially zero, because you are so far out in the left tail of the distribution. So, you can ignore the negative sign and treat it as zero. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric

Re: [R] Sweave: include a multi-page-pdf plot

2011-03-27 Thread Duncan Murdoch
On 27/03/2011 1:12 PM, Alexander Engelhardt wrote: Hi, I'm just starting out with Sweave, and I can't get a plot(linmod) to display all four plots: bild= x1- runif(100) x2- rexp(100) y- 3 + 4*x1 + 5*x2 + rnorm(100) mod- lm(y~x1+x2) plot(mod) @ Some Text fig=TRUE= bild @ This plots only

[R] export data to gnuplot

2011-03-27 Thread Denis Kazakiewicz
Hello How to export data frame to file which can be used by gnuplot? P.S. Sorry for naive question __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] grImport/ghostscript problems

2011-03-27 Thread Al Roark
Hi All: I've been struggling for a while trying to get grImport up and running. I'm on a Windows 7 (home premium 64 bit) machine running R-2.12.2 along with GPL Ghostscript 9.01. I've set my Windows PATH variable to point to the Ghostscript \bin and \lib directories, and I've created the

Re: [R] grImport/ghostscript problems

2011-03-27 Thread Paul Murrell
Hi On 28/03/2011 8:13 a.m., Al Roark wrote: Hi All: I've been struggling for a while trying to get grImport up and running. I'm on a Windows 7 (home premium 64 bit) machine running R-2.12.2 along with GPL Ghostscript 9.01. I've set my Windows PATH variable to point to the Ghostscript \bin and

Re: [R] grImport/ghostscript problems

2011-03-27 Thread Al Roark
Paul Murrell p.murrell at auckland.ac.nz writes: Hi On 28/03/2011 8:13 a.m., Al Roark wrote: Hi All: I've been struggling for a while trying to get grImport up and running. I'm on a Windows 7 (home premium 64 bit) machine running R-2.12.2 along with GPL Ghostscript 9.01. I've set

Re: [R] export data to gnuplot

2011-03-27 Thread Petr Savicky
On Sun, Mar 27, 2011 at 10:12:38PM +0300, Denis Kazakiewicz wrote: Hello How to export data frame to file which can be used by gnuplot? Hello: Try the following write.table(dat, file=out.txt, row.names=FALSE, col.names=FALSE, quote=FALSE) This will save a space delimited file. I am not

Re: [R] World plots and clipping regions

2011-03-27 Thread Ray Brownrigg
Not with the code as it is provided. However with a reasonably easy modification to map.grid() (to return the coordinates of the red dotted line) and a call to polygon(), what you want can be achieved. Let me know if you need further details. Ray Brownrigg On 03/26/11 10:11, Saptarshi Guha

[R] function to compare Brier scores from two models?

2011-03-27 Thread Seth
Hi, I have probability estimates from two predictive models. I have these estimates and also a binary outcome for a validation data set not used in calibrating either model. I would like to calculate the Brier score for both models on this binary outcome and test the hypothesis that the Brier

[R] comparing heatmaps

2011-03-27 Thread Benton, Paul
Dear all, I've been trying to find how to compare tow different heatmaps but I'm having trouble getting the colors bar to be the same. I'm doing something like the following: library(gplots) dat-cor(matrix(rnorm(100, m=10), nrow=10)) mat-cor(matrix(rnorm(100), nrow=10)) dev.new()

Re: [R] function to compare Brier scores from two models?

2011-03-27 Thread Dennis Murphy
Hi: Try library(sos) # install first if necessary findFn('Brier score') The first place I would look is Frank Harrell's rms package. HTH, Dennis On Sun, Mar 27, 2011 at 1:50 PM, Seth sjmy...@syr.edu wrote: Hi, I have probability estimates from two predictive models. I have these

Re: [R] export data to gnuplot

2011-03-27 Thread Denis Kazakiewicz
Dear Petr Thank you very much У Няд, 27/03/2011 у 22:23 +0200, Petr Savicky піша: On Sun, Mar 27, 2011 at 10:12:38PM +0300, Denis Kazakiewicz wrote: Hello How to export data frame to file which can be used by gnuplot? Hello: Try the following write.table(dat, file=out.txt,

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread David Winsemius
On Mar 27, 2011, at 10:56 AM, chuan_zl wrote: Hello,everybody. My name is Chuan Zun Liang. I come from Malaysia. I am just a beginner for R. Kindly to ask favor about median filter. The problem I facing as below: x-matrix(sample(1:30,25),5,5) x [,1] [,2] [,3] [,4] [,5] [1,]7

[R] overlaying

2011-03-27 Thread Bulent Arikan
Dear List, I am working with a small (3 columns and 9 rows) data table, which contains 9 observations, their mean values and standard deviations (I extracted these data from a huge set and I cannot use the original data). I plotted means (y-axis) and the observations (x-axis) using the plot()

[R] Structural equation modeling in R(lavaan,sem)

2011-03-27 Thread jouba
I am a new user of the function sem in package sem and lavaan for structural equation modeling 1. I don’t know what is the difference between this function and CFA function, I know that cfa for confirmatory analysis but I don’t know what is the difference between confirmatory analysis and

[R] MARS response weights

2011-03-27 Thread Vijayakumar Ramachandran
I am trying to use the mars function from mda package and cannot figure out how to specify the response weights wp parameter. I have tried a vector of size = num_observations as well as num_levels of my response, but in both cases, the function fails with some error about invalid array

[R] ggplot2: ndensity and density parameters

2011-03-27 Thread Jay
Hello, if I want to compare the distributions of two datasets using ggplots, how should I choose the density type? More exactly, what assumptions and are behind the ndensity and density parameters? And when should they be used? See http://had.co.nz/ggplot2/stat_bin.html While I understand that

Re: [R] Importing many files from a single code

2011-03-27 Thread jackjohnson
Exactly what do you mean by import? What commands are you using? You can get a list of the files in a directory and then iterate through reading each one in. If you use 'lapply', you can 'read.table' in some data frames and then 'rbind' them into a single data frame. You need to be more

Re: [R] overlaying

2011-03-27 Thread Peter Alspach
Tena koe There are many ways. I tend to use the arrows() function. See ?arrows HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Bulent Arikan Sent: Monday, 28 March 2011 10:45 a.m. To:

Re: [R] overlaying

2011-03-27 Thread John Kane
--- On Sun, 3/27/11, Bulent Arikan bulent.ari...@gmail.com wrote: From: Bulent Arikan bulent.ari...@gmail.com Subject: [R] overlaying To: r-help@r-project.org Received: Sunday, March 27, 2011, 5:45 PM Dear List, I am working with a small (3 columns and 9 rows) data table, which contains

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread David Winsemius
On Mar 27, 2011, at 1:07 PM, Mike Marchywka wrote: You obviously want to delegate inner loops to R packages that execute as native, hopefully optimized, code. Generally a google search that starts with R CRAN will help. In this case it looks like a few packages available,

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-27 Thread Jeremy Miles
On 27 March 2011 12:12, jouba antr...@hotmail.com wrote: I am a new user of the function sem in package sem and lavaan for structural equation modeling 1. I don’t know what is the difference between this function and CFA function, I know that cfa for confirmatory analysis but I don’t know

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread Bert Gunter
?runmed -- Bert On Sun, Mar 27, 2011 at 2:44 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 27, 2011, at 10:56 AM, chuan_zl wrote: Hello,everybody. My name is Chuan Zun Liang. I come from Malaysia. I am just a beginner for R. Kindly to ask favor about median filter. The problem I

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread Bert Gunter
Oops. My error! You wanted a 2D filter. I suspect a search will find some implementation, but you may wish to consider ?loess instead (there are numerous others, no doubt). -- Bert On Sun, Mar 27, 2011 at 3:30 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 27, 2011, at 1:07 PM, Mike

Re: [R] Asking Favor For the Script of Median Filter

2011-03-27 Thread Mike Marchywka
CC: chuan...@hotmail.com; r-help@r-project.org From: dwinsem...@comcast.net To: marchy...@hotmail.com Subject: Re: [R] Asking Favor For the Script of Median Filter Date: Sun, 27 Mar 2011 18:30:48 -0400 On Mar 27, 2011, at 1:07 PM,

[R] portfolioBacktest in fPortfolio

2011-03-27 Thread Luis Felipe Parra
Hello. I am trying to use the portfolio backtesting function in fPortfolio package, but I don't now why in my version of fPortfolio I don't have either the portfolioBactest nor the portfolioBacktesting functions. Does anybody knows what might be going on? thank you Felipe Parra

Re: [R] portfolioBacktest in fPortfolio

2011-03-27 Thread Yohan Chalabi
LFP == Luis Felipe Parra felipe.pa...@quantil.com.co on Mon, 28 Mar 2011 09:10:33 +0800 LFP Hello. I am trying to use the portfolio backtesting function LFP in fPortfolio LFP package, but I don't now why in my version of fPortfolio I LFP don't have either LFP the portfolioBactest

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-27 Thread jouba
Jeremy thanks a lot for your response I have read sem package help and I currently reading the help of lavaan I see that there is also an other function called lavaan can do the SEM analysis So I wonder what is the difference between this function and the sem function Also I am wondering in the

[R] Import variable labels to data frame columns

2011-03-27 Thread AjayT
Hi, I'm new to R and I'm stuck trying to import some data from a .dat file I've been given. The tricky bit for me is that the data has both variable values and labels? The data looks like this, Id=1 time=2011-03-27 19:23:40 start=1.4018 end=1.4017 Id=2 time=2011-03-27 19:23:40

[R] Splitting Datasets

2011-03-27 Thread Wainscott, Robert LT
On R 2.12 for Mac OSX, I have a dataset with both numerical and character values. I want to split dataset ZIDL, into individual datasets based on the string content of variable Dept. I can create one subset dataset at a time using a script I found on the net, but rather than run the same

Re: [R] Importing many files from a single code

2011-03-27 Thread chuan_zl
Dear Ram Kumar Basent: I suggest you restore you file is list. I give my example that I read 50 image by 50 folder. imgA-list() -create an empty list for(i in 1:50) -how many file you need to looping. { imgA[[i]]-read.jpeg(paste(c:/DataCentre/DataPisA/A,i,FP3.jpg,sep=))) } This is my

Re: [R] Splitting Datasets

2011-03-27 Thread Jack Tanner
Wainscott, Robert LT robert.wainscott at cvn74.navy.mil writes: I want to split dataset ZIDL, into individual datasets based on the string content of variable Dept. There are many, many ways to do this, depending on what you're really after. Here's one: depts = levels(factor(zidl$dept)) for

[R] altering a call variable from quote()

2011-03-27 Thread Jack Tanner
I have a variable of mode call: b = quote(b==3) b b == 3 Now I want to append x 2 to the value of b. How do I do that? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Degrees of freedom for lm in logLik and AIC

2011-03-27 Thread Frank Harrell
I have a question about the computation of the degrees of freedom in a linear model: x - runif(20); y - runif(20) f - lm(y ~ x) logLik(f) 'log Lik.' -1.968056 (df=3) The 3 is coming from f$rank + 1. Shouldn't it be f$rank? This affects AIC(f). Thanks Frank - Frank Harrell Department of

Re: [R] Splitting Datasets

2011-03-27 Thread Bert Gunter
Please start by read ing An Introduction to R. You need to understand R data structures and how it works AS A LANGUAGE. Forget about Minitab (while you are in R). ?tapply -- Bert On Sun, Mar 27, 2011 at 5:50 PM, Wainscott, Robert LT robert.wainsc...@cvn74.navy.mil wrote: On R 2.12 for Mac

Re: [R] Import variable labels to data frame columns

2011-03-27 Thread Jack Tanner
AjayT ajaytalati at googlemail.com writes: The data looks like this, Id=1 time=2011-03-27 19:23:40 start=1.4018 end=1.4017 Id=2 time=2011-03-27 19:23:40 start=1.8046 end=1.8047 Something like this would do: lines = scan(file, nlines=1, ...) fields = strsplit(lines[1], \s+,

Re: [R] Splitting Datasets

2011-03-27 Thread Steve Lianoglou
Hi, Answers inline: On Sun, Mar 27, 2011 at 8:50 PM, Wainscott, Robert LT robert.wainsc...@cvn74.navy.mil wrote: On R 2.12 for Mac OSX, I have a dataset with both numerical and character values. I want to split dataset ZIDL, into individual datasets based on the string content of variable

Re: [R] altering a call variable from quote()

2011-03-27 Thread Jack Tanner
Jack Tanner ihok at hotmail.com writes: b = quote(b==3) Now I want to append x 2 to the value of b. How do I do that? Never mind, I figured it out: substitute(b x 2, list(b=b)) __ R-help@r-project.org mailing list

[R] maximum likelihood accuracy - comparison with Stata

2011-03-27 Thread Alex Olssen
Hi everyone, I am looking to do some manual maximum likelihood estimation in R. I have done a lot of work in Stata and so I have been using output comparisons to get a handle on what is happening. I estimated a simple linear model in R with lm() and also my own maximum likelihood program.

Re: [R] Import variable labels to data frame columns

2011-03-27 Thread Gabor Grothendieck
On Sun, Mar 27, 2011 at 9:40 PM, AjayT ajaytal...@googlemail.com wrote: Hi, I'm new to R and I'm stuck trying to import some data from a .dat file I've been given. The tricky bit for me is that the data has both variable values and labels? The data looks like this, Id=1 time=2011-03-27