similar to: Quantile regression: Discrepencies Between optimizer and rq()

Displaying 20 results from an estimated 10000 matches similar to: "Quantile regression: Discrepencies Between optimizer and rq()"

2008 Sep 23
1
quantile regression: plotting coefficients on only one variable (rq)
Dear all. I have a question on plotting the coefficients from a series of mutivariate quantile regressions. The following code plots the coefficients for each RHS variable x1 and x2. Is there a way to plot only the coefficients on x1? In the data I am using, I have a large number of fixed effects and do want to plot the coefficients on these fixed effects. quant.plot <-
2010 May 17
3
applying quantile to a list using values of another object as probs
Hi r-users, I have a matrix B and a list of 3x3 matrices (mylist). I want to calculate the quantiles in the list using each of the value of B as probabilities. The codes I wrote are: B <- matrix (runif(12, 0, 1), 3, 4) mylist <- lapply(mylist, function(x) {matrix (rnorm(9), 3, 3)}) for (i in 1:length(B)) { quant <- lapply (mylist, quantile, probs=B[i]) } But quant
2010 May 16
1
problems with generation of quantiles under For ()
Dear, I want to make an application to calculate quantile within a For() I tried the following without success: ej. date p_val <- matrix(sample(10, 1000, replace=TRUE), 200,5) test 1 rr <- paste("p_val$",names(p_val[1]), sep="") quant <- quantile(rr, probs = c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)/100, na.rm=FALSE, type=1) test 2 rr <-
2009 Jul 21
1
package quantreg behaviour in weights in function rq,
Dear all, I am having v.4.36 of Quantreg package and I noticed strange behaviour when weights were added. Could anyone please explain me what if the results are really strange or the behavioiur is normal. As an example I am using dataset Engel from the package and my own weights. x<-engel[1:50,1] y<-engel[1:50,2] w<-c(0.00123, 0.00050, 0.00126, 0.00183, 0.00036, 0.00100, 0.00122,
2004 Jul 19
3
why won't rq draw lines?
I've been trying to draw quantile linear regression lines across a scatterplot of my data using attach(forrq) plot(PREGNANT,DAY8,xlab="pregnant EPDS",ylab="postnatal EPDS",cex=.5) taus <- c(.05,.1,.25,.75,.9,.95) xx <- seq(min(PREGNANT),max(PREGNANT),100) for(tau in taus){ f <- coef(rq(DAY8~PREGNANT,tau=tau)) yy <-
2009 Apr 25
3
Nomogram with stratified cph in Design package
Hello, I am using Dr. Harrell's design package to make a nomogram. I was able to make a beautiful one without stratifying, however, I will need to stratify to meet PH assumptions. This is where I go wrong, but I'm not sure where. Non-Stratified Nomogram:
2007 Oct 03
2
Shading area under density curves
Hello, I have a question regarding shading regions under curves to display 95% confidence intervals. I generated bootstrap results for the slope and intercept of a simple linear regression model using the following code (borrowed from JJ Faraway 2005): > attach(allposs.nine.d) > x<-model.matrix(~log(d.dist,10))[,-1] > bcoef<-matrix(0,1000,2) > for(i in 1:1000){ +
2010 Apr 09
2
How to use tapply for quantile
I am trying to calculate quantiles of a data frame column split up by two factors: # Calculate the quantiles quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile, na.rm = TRUE) This does not work: > quarts 04L 04R 15R 22L 22R 27 32 33L 33R 0 NULL Numeric,5 NULL Numeric,5 NULL Numeric,5 NULL Numeric,5 NULL 1 NULL
2006 Oct 25
1
Quantile Regression
Hi, how is it possible to retrieve the corresponding tau value for each observed data pair (x(t) y(t), t=1,...,n) when doing a quantile regression like rq.fit <- rq(y~x,tau=-1). Thank you for your help. Jaci --
2008 Aug 07
2
panel.arrows problem in custom panel function
Dear List, I am writing a custom panel function and xyplot method to plot the results of a procrustes analysis from the vegan package. I am having trouble getting the call to panel.arrows to work as I wish when conditioning. The attached file contains the function definitions for the xyplot method and the custom panel and prepanel functions I am using. This example, using data and functions from
2004 May 07
1
Quantile of a function
I have a simple doubt: I have a function, say: test <- function (theta) { return (theta^2) } I can use: integrate (test,0,1) to obtain the area under de function. Can I do the opposite? I`d like to give the lower limit and the area I need as arguments, in order to get the upper limit. In other words, I`d like to obtain the quantile of the function (the lower limit could be 0, for example).
2007 Feb 05
3
Confidence intervals of quantiles
Can anyone please tell me if there is a function to calculate confidence intervals for the results of the quantile function. Some of my data is normally distributed but some is also a squewed distribution or a capped normal distribution. Some of the data sets contain about 700 values whereas others are smaller with about 100-150 values, so I would like to see how the confidence intervals change
2008 Feb 21
1
anova power calculations
I sent a message a couple days ago about doing calculations for power of the ANOVA. Several people got back to me very quickly which I really appreciated. I'm working now on a similar problem, but instead of a balanced ANOVA, I have an unbalanced one. The first part of the question was: You assume that the within-population standard deviations all equal 9. You set the Type 1 error rate at รก
2006 Jul 23
1
Warning Messages using rq -quantile regressions
I am a new to using quantile regressions in R. I have estimated a set of coefficients using the method="br" algorithm with the rq command at various quantiles along the entire distribution. My data set contains approximately 2,500 observations and I have 7 predictor variables. I receive the following warning message: Solution may be nonunique in: rq.fit.br(x, y, tau = tau, ...)
2008 Sep 30
1
Quantile Regression for Longitudinal Data. Warning message: In rq.fit.sfn
Hi, I am trying to estimate a quantile regression using panel data. I am trying to use the model that is described in Dr. Koenker's article. So I use the code the that is posted in the following link: http://www.econ.uiuc.edu/~roger/research/panel/rq.fit.panel.R While this code run perfectly, it does not work for my data providing a warning message: In rq.fit.sfn(D, y, rhs = a) : tiny
2011 Jan 26
1
Quantile regression (rq) and complex samples
I am new to R and am interested in using the program to fit quantile regression models to data collected from a multi-stage probability sample of the US population. The quantile regression package, rq, can accommodate person weights. However, it is not clear to me that boot.rq is appropriate for use with multi-stage samples (i.e., is capable of sampling primary sampling units instead of survey
2005 Aug 05
1
contrast {Design} question
All, I have been trying to get the following code to work: A.quantiles <- quantile(foo.frame$A, probs = seq(from = 0.05, to = 0.95, by = 0.05)) base.quantiles <- quantile(Efficacy205$BASELINE_RANK, probs = seq(from = 0.05, to = 0.95, by = 0.05)) gender <- levels(Efficacy205$GENDER) contrast.1 <- contrast(Model.1, list(TPCODE= 'A', AGE =
2011 Oct 24
2
Syntax Help for xyplot()
Thanks to David's help I subset my large data set and produced a smaller one for a single stream and 7 factors of interest. The structure of this data frame is: str(burns.tds.anal) 'data.frame': 718 obs. of 4 variables: $ site : Factor w/ 143 levels "BC-0.5","BC-1",..: 1 1 4 6 4 4 4 5 5 5 $ sampdate: Date, format: "1996-06-02"
2005 Jul 28
3
using integrate with optimize nested in the integration
Hi guys im having a problem getting R to numerically integrate for some function, say f(bhat)*optimize(G(bhat)), over bhat. Where id like to integrate this over some finite range, so that here as we integrate over bhat optimize would return a different optimum. For instance consider this simple example for which I cannot get R to return the desired result: f <- function(bhat) exp(bhat) g
2012 Feb 22
2
rank with uniform count for each rank
Hello, What is the best way to get ranks for a vector of values, limit the range of rank values and create equal count in each group? I call this uniform ranking...uniform count/number in each group. Here is an example using three groups: Say I have values: x = c(3, 2, -3, 1, 0, 5, 10, 30, -1, 4) names(x) = letters[1:10] > x a b c d e f g h i j 3 2 -3 1 0 5 10 30 -1 4 I