Re: [R] quantile from quantile table calculation without original data

2021-03-12 Thread Abby Spurdle
re always twist the original data and spits only > descriptive results. > > All your results are quite consistent with the available values as they are > close to 1, so for me, each approach works. > > Thank you again. > > Best regards. > Petr > > > -----Origina

Re: [R] quantile from quantile table calculation without original data

2021-03-08 Thread PIKAL Petr
David Winsemius > Sent: Sunday, March 7, 2021 1:33 AM > To: Abby Spurdle ; PIKAL Petr > > Cc: r-help@r-project.org > Subject: Re: [R] quantile from quantile table calculation without original > data > > > On 3/6/21 1:02 AM, Abby Spurdle wrote: > > I came up w

Re: [R] quantile from quantile table calculation without original data

2021-03-08 Thread Jeff Newmiller
I am aware of that... I have my own functions for this purpose that use splinefun. But if you are trying to also do other aspects of probability distribution calculations, it looked like using fBasics would be easier than re-inventing the wheel. I could be wrong, though, since I haven't used fBa

Re: [R] quantile from quantile table calculation without original data

2021-03-08 Thread Martin Maechler
> Jeff Newmiller > on Fri, 05 Mar 2021 10:09:41 -0800 writes: > Your example could probably be resolved with approx. If > you want a more robust solution, it looks like the fBasics > package can do spline interpolation. base R's spline package does spline interpolation

Re: [R] quantile from quantile table calculation without original data

2021-03-06 Thread David Winsemius
On 3/6/21 1:02 AM, Abby Spurdle wrote: I came up with a solution. But not necessarily the best solution. I used a spline to approximate the quantile function. Then use that to generate a large sample. (I don't see any need for the sample to be random, as such). Then compute the sample mean and

Re: [R] quantile from quantile table calculation without original data

2021-03-06 Thread Abby Spurdle
I came up with a solution. But not necessarily the best solution. I used a spline to approximate the quantile function. Then use that to generate a large sample. (I don't see any need for the sample to be random, as such). Then compute the sample mean and sd, on a log scale. Finally, plug everythi

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Abby Spurdle
I'm sorry. I misread your example, this morning. (I didn't read the code after the line that calls plot). After looking at this problem again, interpolation doesn't apply, and extrapolation would be a last resort. If you can assume your data comes from a particular type of distribution, such as a

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Abby Spurdle
I note three problems with your data: (1) The name "percent" is misleading, perhaps you want "probability"? (2) There are straight (or near-straight) regions, each of which, is equally (or near-equally) spaced, which is not what I would expect in problems involving "quantiles". (3) Your plot (appro

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread David Winsemius
On 3/5/21 1:14 AM, PIKAL Petr wrote: Dear all I have table of quantiles, probably from lognormal distribution dput(temp) temp <- structure(list(size = c(1.6, 0.9466, 0.8062, 0.6477, 0.5069, 0.3781, 0.3047, 0.2681, 0.1907), percent = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99)), .Na

Re: [R] quantile from quantile table calculation without original data

2021-03-05 Thread Jeff Newmiller
Your example could probably be resolved with approx. If you want a more robust solution, it looks like the fBasics package can do spline interpolation. You may want to spline on the log of your size variable and use exp on the output if you want to avoid negative results. On March 5, 2021 1:14

Re: [R] Quantile Density Contours

2019-03-30 Thread Abs Spurdle
My R package, "probhat", provides plots of bivariate PDFs and bivariate CDFs, using kernel smoothing. Note that there is no bivariate quantile function, as such. Here's the vignette: https://cran.r-project.org/web/packages/probhat/vignettes/probhat.pdf This contains examples. Note that I'm not s

Re: [R] Quantile Density Contours

2019-03-29 Thread Bernard Comcast
Thanks Abs - I was able to get the plot I needed with the hdrcde package but I will check out your package as well. I continue to be impressed with the power Of R and the various packages available. Thanks again Bernard Sent from my iPhone so please excuse the spelling!" > On Mar 29, 2019, a

Re: [R] Quantile Density Contours

2019-03-27 Thread Bernard McGarvey
John, I have attached a pdf of the plot. Hopefully you can read this. If I understand correctly, this plot is basically the 2-D version of the 1-D quantile plot. Thanks Bernard McGarvey Director, Fort Myers Beach Lions Foundation, Inc. Retired (Lilly Engineering Fellow). > On March 27, 20

Re: [R] Quantile Density Contours

2019-03-27 Thread John Kane
The figure did not get through. Perhaps try a pdf? On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey wrote: > > I want to see if I can reproduce the plot below in R. If I understand it > correctly, i takes my bivariate data and creates quantile density contours. > My interpretation of these conto

Re: [R] quantile regression: warning message

2015-10-13 Thread T.Riedle
: R-help@r-project.org Subject: Re: [R] quantile regression: warning message see the output from the quantreg FAQ: FAQ() especially point 2. url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558

Re: [R] quantile regression: warning message

2015-10-13 Thread Roger Koenker
see the output from the quantreg FAQ: FAQ() especially point 2. url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Urba

Re: [R] Quantile Regression without intercept

2015-10-07 Thread Roger Koenker
me implies 0 expenditure, then all (quantile) Engel curves pass through the origin and one might want to impose this. On the other hand maybe not... > From: Roger Koenker > Sent: ‎06-‎10-‎2015 07:09 PM > To: Lorenz, David > Cc: r-help@r-project.org > Subject: Re: [R] Quantile R

Re: [R] Quantile Regression without intercept

2015-10-07 Thread Preetam Pal
e that. > > > > > > > >> Date: Mon, 5 Oct 2015 21:14:04 +0530 > >> From: Preetam Pal > >> To: stephen sefick > >> Cc: "r-help@r-project.org" > >> Subject: Re: [R] Quantile Regression without intercept > >> Mess

Re: [R] Quantile Regression without intercept

2015-10-06 Thread peter dalgaard
To wit: > y <- rnorm(100, 10) > x <- 1:100 > sum(resid(lm(y~x))) [1] 1.047773e-15 > sum(resid(lm(y~x-1))) [1] 243.0583 and replicating this should convince you that the mean residual really is not zero in the severely misspecified model with no intercept. (This has to do with the fact that resi

Re: [R] Quantile Regression without intercept

2015-10-06 Thread Roger Koenker
ate: Mon, 5 Oct 2015 21:14:04 +0530 > >> From: Preetam Pal > >> To: stephen sefick > >> Cc: "r-help@r-project.org" > >> Subject: Re: [R] Quantile Regression without intercept > >> Message-ID: <56129a41.025f440a.b1cf4.f...@mx.google.com> > &g

Re: [R] Quantile Regression without intercept

2015-10-06 Thread Lorenz, David
>> Date: Mon, 5 Oct 2015 21:14:04 +0530 > >> From: Preetam Pal > >> To: stephen sefick > >> Cc: "r-help@r-project.org" > >> Subject: Re: [R] Quantile Regression without intercept > >> Message-ID: <56129a41.025f440a.b1cf4.f...@mx.goo

Re: [R] Quantile Regression without intercept

2015-10-06 Thread Roger Koenker
etam Pal >> To: stephen sefick >> Cc: "r-help@r-project.org" >> Subject: Re: [R] Quantile Regression without intercept >> Message-ID: <56129a41.025f440a.b1cf4.f...@mx.google.com> >> Content-Type: text/plain; charset="UTF-8" >> >> Ye

Re: [R] Quantile Regression without intercept

2015-10-06 Thread Lorenz, David
:04 +0530 > From: Preetam Pal > To: stephen sefick > Cc: "r-help@r-project.org" > Subject: Re: [R] Quantile Regression without intercept > Message-ID: <56129a41.025f440a.b1cf4.f...@mx.google.com> > Content-Type: text/plain; charset="UTF-8" > > Ye

Re: [R] Quantile Regression without intercept

2015-10-05 Thread Preetam Pal
Yes..it works. Thanks 😃 -Original Message- From: "stephen sefick" Sent: ‎05-‎10-‎2015 09:01 PM To: "Preetam Pal" Cc: "r-help@r-project.org" Subject: Re: [R] Quantile Regression without intercept I have never used this, but does the formula inter

Re: [R] Quantile Regression without intercept

2015-10-05 Thread stephen sefick
I have never used this, but does the formula interface work like lm? Y~X-1? On Mon, Oct 5, 2015 at 10:27 AM, Preetam Pal wrote: > Hi guys, > > Can you instruct me please how to run quantile regression without the > intercept term? I only know about the rq function under quantreg package, > but i

Re: [R] Quantile Regression without intercept

2015-10-05 Thread Roger Koenker
as for lm() or any other linear model fitting…. rq( y ~ x - 1, … ) url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678U

Re: [R] quantile of a discrete random variabel --- again

2015-06-25 Thread Bert Gunter
Well, presumably you have the pmf and can create a matrix of the form: (where mypmf is your pmf) x <- seq_len(1000) ## or whatever your discrete support sorted in increasing order ## for individual quantile q: max(x[cumsum(mypmf(x)) <= q] ) ## This probably could be vectorized for a vector of q

Re: [R] quantile of a discrete random variable

2015-06-25 Thread David Winsemius
On Jun 25, 2015, at 7:26 AM, L... L... wrote: > Dear all, is there a general method for calculating the quantile of a > discrete random variable? If yes, is there a R function to do this? The `quantile` function would seem to be the first place to go. It may depend on the object-type of your r

Re: [R] quantile of a discrete random variable

2015-06-25 Thread David L Carlson
There is a function called quantile() that provides 9 methods of computing quantiles, three of which are appropriate for discontinuous data. Type ?quantile at the command prompt for details. - David L Carlson Department of Anthropology Texas A&M University Co

Re: [R] Quantile regression model with nonparametric effect and interaction

2015-06-11 Thread Waltl, Sofie (sofie.wa...@uni-graz.at)
loop therefore does not really help... -Original Message- From: Roger Koenker [mailto:rkoen...@illinois.edu] Sent: Donnerstag, 11. Juni 2015 15:33 To: Waltl, Sofie (sofie.wa...@uni-graz.at) Cc: r-help@r-project.org Subject: Re: [R] Quantile regression model with nonparametric effec

Re: [R] Quantile regression model with nonparametric effect and interaction

2015-06-11 Thread Roger Koenker
The main effect trend seems rather dangerous, why not just estimate the f’s in a loop? url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678

Re: [R] Quantile

2014-09-15 Thread David Winsemius
On Sep 15, 2014, at 11:17 AM, Felix Dietrich wrote: > Hi, I want to use the quantile function, the example shown under "help" > > x <- rnorm(1001) > quantile(x <- rnorm(1001)) # Extremes & Quartiles by default > quantile(x, probs = c(0.1, 0.5, 1, 2, 5, 10, 50, NA)/100) > > I get the following

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-17 Thread Zilefac Elvis
Hi AK, Thanks very much for the updated code. My simulated results are even more consistent with observations after apply the updated version of the code. Cheers, Atem. On Wednesday, April 16, 2014 11:31 PM, Zilefac Elvis wrote: Hi AK, Thanks very much. Atem. On Wednesday, April 16, 2014

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-16 Thread Zilefac Elvis
Hi AK, Thanks very much. Atem. On Wednesday, April 16, 2014 9:32 PM, arun wrote: Hi, Use this code after `lst2`. lapply(seq_along(lst2), function(i) {     lstN <- lapply(lst2[[i]], function(x) {         datN <- as.data.frame(matrix(NA, nrow = 101, ncol = length(names1), dimnames = list(NULL,

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-16 Thread arun
Hi, Use this code after `lst2`. lapply(seq_along(lst2), function(i) { lstN <- lapply(lst2[[i]], function(x) { datN <- as.data.frame(matrix(NA, nrow = 101, ncol = length(names1), dimnames = list(NULL, names1))) x1 <- x[, -1] qt <- numcolwise(function(y) quan

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-15 Thread Zilefac Elvis
Hi AK, Thanks very much. I worked great. Many thanks. Atem. On Tuesday, April 15, 2014 9:20 AM, arun wrote: Hi Atem, May be this works. ### Q1: working directory: Observed #Only one file per Site.  Assuming this is the ### case for the full dataset, then I guess there is no need to average di

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-15 Thread arun
Hi Atem, May be this works. ### Q1: working directory: Observed #Only one file per Site. Assuming this is the ### case for the full dataset, then I guess there is no need to average dir.create("final") lst1 <- split(list.files(pattern = ".csv"), gsub("\\_.*", "", list.files(pattern = ".csv")))

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-14 Thread Zilefac Elvis
Hi AK, All codes for simulation files work great. I will try the code for observations and let you know. Thanks very much. Atem. On Tuesday, April 15, 2014 12:01 AM, arun wrote: Yes, my new solution ignores such cases. On Monday, April 14, 2014 11:58 PM, Zilefac Elvis wrote: Hi AK,

Re: [R] Quantile and rowMean from multiple files in a folder

2014-04-14 Thread arun
Hi Atem, I guess this is what you wanted. ###Q1: ### ###working directory: Observed  #Only one file per Site.  Assuming this is the case for the full dataset, then I guess there is no need to average dir.create("final") lst1 <- split(list.files(pattern = ".csv"), gsub("\\_.*", "", list.files(

Re: [R] Quantile and rowMean from multiple files in a folder

2014-04-14 Thread zilefacel...@yahoo.com
Hi AK, Thanks very much. I did send you another email with a larger Sample.zip file. The Quantilecode.R which you initially developed for a smaller sample.zip did not complete the task when I used it for a larger data set. Please check to rectify the error message.

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-14 Thread arun
Hi, Q1 solution already sent. Regarding Q2, one of the files in the new Observed folder doesn't have any  data (just the Year column alone). That may be the reason for the problem. ### Q1: working directory: Observed #Only one file per Site.  Assuming this is the ### case for the full data

Re: [R] : Quantile and rowMean from multiple files in a folder

2014-04-14 Thread arun
Hi, It is because of different dimensions of Simulation data  within each Site. Try: dir.create("final") lst1 <- split(list.files(pattern = ".csv"), gsub("\\_.*", "", list.files(pattern = ".csv"))) sapply(lst1,length) #G100 G101 G102 G103 G104 G105 G106 G107 G108 G109 G110 G111 G112 G113 G114 G

Re: [R] Quantile and rowMean from multiple files in a folder

2014-04-13 Thread Zilefac Elvis
Hi AK, I must admit that you did an excellent job. Thanks very much. My analysis is manageable now. Regards, Atem. On Sunday, April 13, 2014 8:54 AM, arun wrote: Hi, I am formatting the codes using library(formatR).  Hopefully, it will not be mangled in the email. dir.create("final") lst1 <- s

Re: [R] Quantile and rowMean from multiple files in a folder

2014-04-13 Thread arun
Hi, I am formatting the codes using library(formatR).  Hopefully, it will not be mangled in the email. dir.create("final") lst1 <- split(list.files(pattern = ".csv"), gsub("\\_.*", "", list.files(pattern = ".csv"))) lst2 <- lapply(lst1, function(x1) lapply(x1, function(x2) { lines1 <- readLine

Re: [R] Quantile Regression/(package (quantreg))

2013-06-28 Thread Frank Harrell
Mike, Do something like: require(rms) dd <- datadist(mydatarame); options(datadist='dd') f <- Rq(y ~ rcs(age,4)*sex, tau=.5) # use rq function in quantreg summary(f) # inter-quartile-range differences in medians of y (b/c tau=.5) plot(Predict(f, age, sex)) # show age effect on median as a co

Re: [R] quantile

2013-06-19 Thread S Ellison
Or cast to vector: > set.seed(28) >  x<- sample(1:40,20,replace=TRUE) >  qx<-quantile(x,probs=0.10) >  qx > #10% > #3.8 > as.vector(qx) > #3.8 *** This email and any attachments are confidential. Any use...{{dropped:8}}

Re: [R] quantile

2013-06-19 Thread arun
Hi, May be this helps: set.seed(28)  x<- sample(1:40,20,replace=TRUE)  qx<-quantile(x,probs=0.10)  qx #10% #3.8  qx+1 #10% #4.8 attr(qx,"names")<-NULL qx #[1] 3.8  qx+1 #[1] 4.8 A.K.   - Original Message - From: Francesco Miranda To: "r-help@r-project.org" Cc: Sent: Wednesday, J

Re: [R] Quantile regression for binary choice and heckit

2013-05-29 Thread Roger Koenker
This is a bit like asking how should I tweak my sailboat so I can explore the ocean floor. url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678

Re: [R] quantile regression using copulas

2012-10-21 Thread indus
Hi Marius, I have tried debugging the qua.regressCOP2 function. The error I'am getting is: "Error in cop(u, v + delv, ...) : unused argument(s) (v + delv)". Unable to decipher it. And have mailed to william.asquith at ttu.edu>. Thanks indu -- View this message in context: http://r.789695.n4

Re: [R] quantile regression using copulas

2012-10-21 Thread Marius Hofert
Please note: 1) your example is not working in the way you provided it (see http://www.minimalbeispiel.de/mini-en.html) 2) you receive a warning, not an error 3) I'd try and debug qua.regressCOP2 to see why the warning appears 4) in case 3) does not help, contact the maintainer of copBasic (Willia

Re: [R] Quantile Regression - Testing for Non-causalities in quantiles

2012-07-16 Thread Roger Koenker
Take a look at demo(Mel) in the quantreg package. Roger Koenker rkoen...@illinois.edu On Jul 14, 2012, at 6:55 AM, stefan23 wrote: > Dear all, > I am searching for a way to compute a test comparable to Chuang et al. > ("Causality in Quantiles and Dynamic Stock > Return-Volume Relations"). Th

Re: [R] Quantile regression: Discrepencies Between optimizer and rq()

2012-06-07 Thread Roger Koenker
Optim() by default is using Nelder-Mead which is an extremely poor way to do linear programming, despite the fact that ?optim says that: "It will work reasonably well for non-differentiable functions."I didn't check your coding of the objective function fully, but at the very least you sho

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-03-01 Thread Thomas Lumley
On Thu, Mar 1, 2012 at 12:07 PM, Doran, Harold wrote: > Typically this list doesn't support general statistical questions and > unfortunately I don't have a better recommendation. It may be more helpful > for you to work with a statistician than seek help here. > > My point is simply that quanti

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-02-29 Thread Doran, Harold
ay, February 29, 2012 5:52 PM To: Doran, Harold Cc: Rob James; r-help@r-project.org Subject: Re: [R] Quantile scores as dependent variables.. an R and general method question On Wed, Feb 29, 2012 at 1:23 PM, Doran, Harold wrote: > > The OP is looking for a way to deal with outcomes scores that

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-02-29 Thread ilai
r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf > Of ilai [ke...@math.montana.edu] > Sent: Wednesday, February 29, 2012 1:30 PM > To: Rob James > Cc: r-help@r-project.org > Subject: Re: [R] Quantile scores as dependent variables.. an R and general > metho

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-02-29 Thread Doran, Harold
eeded. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of ilai [ke...@math.montana.edu] Sent: Wednesday, February 29, 2012 1:30 PM To: Rob James Cc: r-help@r-project.org Subject: Re: [R] Quantile scores as dependent variables.. an R and general method question On Tue, F

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-02-29 Thread ilai
On Tue, Feb 28, 2012 at 3:54 PM, Rob James wrote: > I have a dataset that does not include native scores, but only serial > quantile rankings for a set of units. > > Clearly these observations are dependent (in that you can't alter one > observation without also altering others). > > Are there met

Re: [R] quantile regression: out of memory error

2011-07-11 Thread Brian S Cade
Using tau = -1 is causing rq() to try and estimate all possible quantiles and store the results. With 11253 observations this would be a formidable feat. Try estimating the model with say tau = 1:99/100 to give a more tractable number of estimates. Brian Brian S. Cade, PhD U. S. Geological

Re: [R] quantile regression: out of memory error

2011-07-11 Thread Roger Koenker
Paul, Yours is NOT a large problem, but it becomes a large problem when you ask for ALL the distinct QR solutions by specifying tau = -1. You probably don't want to see all these solutions, I suspect that only tau = 1:19/20 or so would suffice. Try this, and see how it goes. Roger url:ww

Re: [R] quantile regression: out of memory error

2011-07-11 Thread Prew, Paul
Koenker [mailto:rkoen...@uiuc.edu] Sent: Monday, July 11, 2011 12:48 PM To: Prew, Paul Cc: r-help@r-project.org help Subject: Re: [R] quantile regression: out of memory error Paul, Yours is NOT a large problem, but it becomes a large problem when you ask for ALL the distinct QR solutions by

Re: [R] Quantile Regression and R

2011-04-11 Thread Sheldrick, Peter (Specialty Casualty UW Support)
Pls disregard...I have it figured out. Thank you. Regards, Peter D. Sheldrick Hartford Financial Services Group > _ > From: Sheldrick, Peter (Specialty Casualty UW Support) > Sent: Friday, April 08, 2011 9:53 AM > To: 'r-help@R-project.

Re: [R] Quantile Regression and R

2011-04-08 Thread Frank Harrell
Dear Peter, Quantile regression is a nice tool but one that requires some statistical training in order to use it and interpret the results properly. I suggest backing up a bit. Frank Sheldrick, Peter (Specialty Casualty UW Support) wrote: > > Sir or Madam: > > I am new to R and the

Re: [R] quantile function -> I need only the quantile value itself

2011-03-28 Thread Peter Ehlers
On 2011-03-28 02:51, Mohamed Lajnef wrote: HI Laszlo, q<-quantile(small_df,probs=0.95) q[[1]] [1] 12.85 Regrads Or, perhaps more succinctly: unname(q) since '95%' is just the name of the vector. Peter Ehlers Le 28/03/11 11:37, Bodnar Laszlo EB_HU a écrit : Hi, I am using the quan

Re: [R] quantile function -> I need only the quantile value itself

2011-03-28 Thread Mohamed Lajnef
HI Laszlo, q<-quantile(small_df,probs=0.95) q[[1]] [1] 12.85 Regrads Le 28/03/11 11:37, Bodnar Laszlo EB_HU a écrit : > Hi, > > I am using the quantile function currently and I have just bumped into a > little problem. > > I have a very small data frame something like this: > > small_df<-

Re: [R] Quantile regression (rq) and complex samples

2011-01-27 Thread Thomas Lumley
You could use the survey package to run the bootstrapping, if you mean the Rao & Wu bootstrap that samples n-1 of n PSUs in each replicate. Set up a survey design object with bootstrap replicate weights: use svrepdesign() if you already have replicate weights, use svydesign() and then as.svrepdesi

Re: [R] Quantile Regression: Extracting Residuals

2011-01-19 Thread Jonathan P Daily
Try looking here: ?rq.object ?residuals R has excellent documentation that can answer many such questions with less than a minute of reading. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-448

Re: [R] quantile regression

2010-10-07 Thread Julia Lira
Thank you all for the explanation! Best, Julia > Date: Thu, 7 Oct 2010 22:37:32 +1100 > Subject: Re: [R] quantile regression > From: michael.bedw...@gmail.com > To: martyn.b...@nag.co.uk > CC: julia.l...@hotmail.co.uk; r-help@r-project.org > > Hi Julia, > &

Re: [R] quantile regression

2010-10-07 Thread Michael Bedward
Hi Julia, In addition to Martyn's answer and David's friendly post I'd just add that it's not a good idea to call a variable "c" since the function of that name is so often used in R. Michael On 7 October 2010 22:28, Martyn Byng wrote: > Hi, > > Your code is of the form > > for (i in 1:nsim) {

Re: [R] quantile regression

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 6:40 AM, Julia Lira wrote: Dear all, I am a new user in r and I am facing some problems with the quantile regression specification. I have two matrix (mresultb and mresultx) with nrow=1000 and ncol=nsim, where I specify (let's say) nsim=10. Hence, the columns in my

Re: [R] quantile regression

2010-10-07 Thread Martyn Byng
Hi, Your code is of the form for (i in 1:nsim) { ## Do something that generates variable qf05 M <- coeff(qf05) } This means that you are overwriting the variable M at each iteration and so when the loop has finished you only have the coefficients from the last simulation. There are lots of

Re: [R] quantile regression

2010-10-07 Thread Julia Lira
,i] <- coef(qf05) } I am quite sure there is a mistake in the code: qf05 <- rq(formula = mresultb[,i] ~ mresultx[,i], tau=0.5) because it is just generating the coefficients for one simulation, not for 10 simulations. best, Julia Date: Thu, 7 Oct 2010 18:51:40 +0800 Subject: Re

Re: [R] Quantile question

2010-10-07 Thread Henrik Bengtsson
Alternatively, see rowQuantiles() in the matrixStats package. /Henrik On Wed, Oct 6, 2010 at 10:34 PM, Joshua Wiley wrote: > Hi, > > This should do it, for details, see ?apply > > a <- matrix(rnorm(1),100,100) > t(apply(a, 1, quantile, probs = c(.3, .5))) > > Basically you apply() the quant

Re: [R] Quantile question

2010-10-06 Thread Joshua Wiley
Hi, This should do it, for details, see ?apply a <- matrix(rnorm(1),100,100) t(apply(a, 1, quantile, probs = c(.3, .5))) Basically you apply() the quantile function to each row (the 1, 2 would indicate columns) in the object 'a'. HTH, Josh On Wed, Oct 6, 2010 at 10:20 PM, Takos wrote: >

Re: [R] quantile() and "factors not allowed"

2010-09-28 Thread Steve
The underlying data contained values that resulted in Factor instead of number fields during the read.csv. Problem fixed! I also introduced a typo while copying the error into my message, and as for the poor variable naming, I'll be more careful. Thanks x3! Corrected structure: > str(CPU) 'dat

Re: [R] quantile() and "factors not allowed"

2010-09-28 Thread Joshua Wiley
Hi Steve, The basic problem (as the error suggests) is that data of class "factor" is not allowed in quantile.default. So one of the elements of your list must be a factor. What are the results of: str(t) ? As a side note, since t() is a function, using t as a variable name can be a bit confu

Re: [R] Quantile Regression and Goodness of Fit

2010-08-23 Thread nikhil kaza
http://www.econ.uiuc.edu/~roger/research/R1/R1.html On Mon, Aug 23, 2010 at 2:15 PM, Steven Ranney wrote: > All - > > Does anyone know if there is a method to calculate a goodness-of-fit > statistic for quantile regressions with package quantreg? > Specifically, I'm wondering if anyone has imple

Re: [R] quantile() depends on order of probs?

2010-06-19 Thread Christos Argyropoulos
Hi, It seems to me that the results are actually the same but they are not returned in the same order (R 2.10.1 in Windows Vista). If you call sort on the output the results will be the same: > sort(quantile(c(54, 72, 83, 112), type=6, probs=c(0, .25, .5, .75, 1)))     0%    25%    50%    75% 

Re: [R] quantile() depends on order of probs?

2010-06-19 Thread Joshua Wiley
Dear Christos, Thank you, the code implemented in 2.10.1 is actually slightly different; the qs variable in the call to quantile is determined by a series of ifelse() statements: qs <- ifelse(h == 0, x[j + 2], ifelse(h == 1, x[j + 3], (1 - h) * x[j + 2] + h * x[j + 3])) so if h is neither 0 nor

Re: [R] Quantile regression - violation of independence

2010-05-17 Thread Bert Gunter
This is not an R question, though you may receive help from this list. But you would probably do better posting on a statistical list, especially one focused on ecology. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] Quantile loess smother?

2010-01-25 Thread Dieter Menne
Tal Galili wrote: > > Something that will be a combination of what rq (package quantreg} does, > with loess. > qss in quantreg comes close. Dieter -- View this message in context: http://n4.nabble.com/Quantile-loess-smother-tp1289277p1289349.html Sent from the R help mailing list archive a

Re: [R] Quantile loess smother?

2010-01-25 Thread Gavin Simpson
On Mon, 2010-01-25 at 14:08 +0200, Tal Galili wrote: > Hello all, > > I wish to fit a loess smother to a plot of Y`X, but in predicting the 95% > quantile. > Something that will be a combination of what rq (package quantreg} does, > with loess. > > Is there a function/method for doing this? ?rqs

Re: [R] quantile fixed effects with weights

2009-06-18 Thread roger
On Jun 18, 2009, at 5:01 AM, alessia matano wrote: Dear all, I 'm implementing the koenker procedure for quantile fixed effects. Who he? Wuz 'dat? I would like also to apply weights to the procedure, so that to give more weight to the observation that better represent my original sample (

Re: [R] Quantile GAM?

2009-06-01 Thread Brian S Cade
There are possibilities with rqss() as someone else mentioned. But you can also conduct a lot of useful modeling just by using b-splines within the the rq function - something like my.result <- rq(y ~ bs(x,degree=3)), where bs() is the b-spline function from the splines package. You get to spe

Re: [R] Quantile GAM?

2009-05-30 Thread Mark Difford
Hi Jonathan, >> I was wondering if anyone had suggestions on how to implement a GAM >> in a quantile fashion? Take a look at the gamlss package. Regards, Mark. Jonathan Greenberg-2 wrote: > > R-ers: > > I was wondering if anyone had suggestions on how to implement a GAM > in a quanti

Re: [R] Quantile GAM?

2009-05-30 Thread Gavin Simpson
On Fri, 2009-05-29 at 16:51 -0700, Jonathan Greenberg wrote: > R-ers: > > I was wondering if anyone had suggestions on how to implement a GAM > in a quantile fashion? I'm trying to derive a model of a "hull" of > points which are likely to require higher-order polynomial fitting (e.g. > sp

Re: [R] Quantile Regression fixed effects model

2009-05-11 Thread Thuy T. Nguyen
Dear R-users, I am applying professor Koenker's code for fixed effect quantile regression. However, I need to bootstrap and cluster the standard errors in my fitted model. Assuming that I need to bootstrap then cluster the standard errors by s (the strata indicator in Prof. Koenker's code), what

Re: [R] Quantile Regression for Longitudinal Data. Warning message: In rq.fit.sfn

2009-05-06 Thread Lola Gadea
Dear Dimitris, I have exactly the same problem than you, Do you get some solution? Thanks, Lola Lola Gadea Profesora titular de Economía Aplicada/Lecturer in Applied Economics Universidad de Zaragoza/University of Zaragoza (Spain) lga...@unizar.es

Re: [R] quantile question

2009-01-22 Thread ANJAN PURKAYASTHA
Thanks all for your prompt and helpful replies! Anjan On Thu, Jan 22, 2009 at 11:52 AM, ANJAN PURKAYASTHA < anjan.purkayas...@gmail.com> wrote: > Hi, > A simple quantile question: > I need to calculate the 95% and 5% quantiles (aka percentiles) for the > following data: > 67.12 > 64.51 > 62.06 >

Re: [R] quantile question

2009-01-22 Thread Dimitris Rizopoulos
have a look at the online help file of ?quantile(); check also: x <- c(67.12, 64.51, 62.06, 55.45, 51.41, 43.78, 10.74, 10.14) sapply(1:9, function (i) quantile(x, c(0.05, 0.95), type = i)) I hope it helps. Best, Dimitris ANJAN PURKAYASTHA wrote: Hi, A simple quantile question: I need to ca

Re: [R] quantile question

2009-01-22 Thread Greg Snow
Read the help page for the quantile function (the whole page, there is a lot of good detail in there), the 2nd reference on the page should also be a helpful read. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Origin

Re: [R] Quantile Regression fixed effects model

2008-11-14 Thread roger koenker
see: http://www.econ.uiuc.edu/~roger/research/panel/rq.fit.panel.R url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign,

Re: [R] Quantile Regression for Longitudinal Data:error message

2008-10-31 Thread roger koenker
If you are going to insist on doing such things you will have to learn to read the documentation. In this case if you do a traceback() you will see that the error is occurring in rq.fit.slm and when you do ?rq.fit.slm you will see that there are several storage sizes that can

Re: [R] Quantile Regression for Longitudinal Data. Warning message: In rq.fit.sfn

2008-09-30 Thread roger koenker
This is a little esoteric for R-help. As the posting guide says, you should write the package maintainer with this sort of question. Without the data it is difficult to judge what is happening, a couple of possibilities are: o all is well and warning just conveys an exaggerated s

Re: [R] quantile

2008-09-29 Thread Ted Harding
On 29-Sep-08 20:09:14, liujb wrote: > Hello, > I need to assign a number to each x[i], i=1:100, based on the > value of x[i] and where they are in the distribution of x[i]. > For example 1 for x[4] means x[4] is below 25%. I can obtain > the quantile using quantile command, and just loop through th

Re: [R] quantile

2008-09-29 Thread jim holtman
?quantile ?cut > x <- runif(10) > y <- quantile(x, prob=seq(0,1,.25)) > y 0%25%50%75% 100% 0.06178627 0.29216247 0.60098370 0.83899171 0.94467527 > cut(x, breaks=y, include.lowest=TRUE) [1] [0.0618,0.292] (0.292,0.601] (0.292,0.601] (0.839,0.945] [0.0618,0.

Re: [R] quantile / centile

2008-09-27 Thread Peter Dalgaard
Donald Braman wrote: Thanks, for the response! Unfortunately, I was unclear; my problem is not that I need to know what the percentile ranges are, but that I need to assign an appropriate percentile range to each of the records in my dataframe. My dataframe contains somewhere between 1000 and 9

Re: [R] quantile / centile

2008-09-27 Thread Donald Braman
Thanks, for the response! Unfortunately, I was unclear; my problem is not that I need to know what the percentile ranges are, but that I need to assign an appropriate percentile range to each of the records in my dataframe. My dataframe contains somewhere between 1000 and 9000 rows/records in my

Re: [R] quantile / centile

2008-09-27 Thread Henrique Dallazuanna
Try this: my.df$my.newvar <- quantile(my.df$my.var, probs = seq(0.01,1, 0.01)) On Sat, Sep 27, 2008 at 3:50 AM, Donald Braman <[EMAIL PROTECTED]> wrote: > I'm wondering if there is a simple way to assign a quantile to a vector in a > data frame, much like one could in Stata using centile. Let's

Re: [R] quantile regression: plotting coefficients on only one variable (rq)

2008-09-23 Thread Mark Difford
Hi Michael, It's in the manual: ?plot.summary.rqs plot(summary(rq(..., tau=c(...)), parm = x1, ...) Regards, Mark. Michael Faye wrote: > > Dear all. > > I have a question on plotting the coefficients from a series of > mutivariate > quantile regressions. The following code plots the coeff

Re: [R] Quantile regression with complex survey data

2008-08-22 Thread Brian S Cade
enter 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: [EMAIL PROTECTED] tel: 970 226-9326 "Stas Kolenikov" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 08/20/2008 01:14 PM To "Cheng, Yiling (CDC/CCHP/NCCDPHP)" <[EMAIL PROTECTED]> cc r-help@r

  1   2   >