Summary Table for Quantile Regression for Complex Survey

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Summary Table for Quantile Regression for Complex Survey

Mavra Ahmed
Hello All,


I am running quantile regression for a complex survey design and am running the following code:

newdf<-withReplicates(df, quote(coef(rq(api00~api99, tau=0.5, weights=.weights))))


This provides me with the theta and SE but I would really like the p-values and residual degrees of freedom.

summary(newdf) function does not work. Does anyone have any idea how to get p-values and rdf?


Thank you for your help,

Mav



        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Summary Table for Quantile Regression for Complex Survey

Roger Koenker-3
try summary(newer, se = “nid”)


Roger Koenker
[hidden email]<mailto:[hidden email]>
Department of Economics, UCL
London  WC1H 0AX.


On Jul 16, 2019, at 2:46 AM, Mavra Ahmed <[hidden email]<mailto:[hidden email]>> wrote:

Hello All,


I am running quantile regression for a complex survey design and am running the following code:

newdf<-withReplicates(df, quote(coef(rq(api00~api99, tau=0.5, weights=.weights))))


This provides me with the theta and SE but I would really like the p-values and residual degrees of freedom.

summary(newdf) function does not work. Does anyone have any idea how to get p-values and rdf?


Thank you for your help,

Mav



[[alternative HTML version deleted]]

______________________________________________
[hidden email]<mailto:[hidden email]> mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Summary Table for Quantile Regression for Complex Survey

Mavra Ahmed
Thank you! I tried that and it gives me the following:

  Min.  1st Qu.   Median     Mean  3rd Qu.     Max.

-0.05904 18.04000 36.15000 36.15000 54.25000 72.35000


I also tried the following code from Geraci:

format.rq.svy<-summary(newdf,rdf){

  V<-attr(newdf,"var")

  FLAG<-length(V)==1

  se<-if(FLAG) sqrt(V) else sqrt(diag(V))

  val<-cbind(as.matrix(newdf),se, NA, NA)

  if(FLAG) val<- matrix(val, nrow=1)

  val[,3]<-val[,1]/val[,2]

  val[,4]<-2*(1-pt(abs(val[,3]),rdf))

  colnames(val)<-c("Value", "Std.Error", "t value", "Pr(>|t|)")

  rownames(val)<-names(newdf)

  return(val)

}


where rdf is the residual degrees of freedom but unable to get information on rdf using "withReplicates". I was thinking if there is way to get rdf for complex survey data using another code and replace it here?


Thanks for your help,

Mavra



________________________________
From: Koenker, Roger W <[hidden email]>
Sent: July 16, 2019 11:37:54 AM
To: Mavra Ahmed
Cc: [hidden email]
Subject: Re: [R] Summary Table for Quantile Regression for Complex Survey

try summary(newer, se = �nid�)


Roger Koenker
[hidden email]<mailto:[hidden email]>
Department of Economics, UCL
London  WC1H 0AX.


On Jul 16, 2019, at 2:46 AM, Mavra Ahmed <[hidden email]<mailto:[hidden email]>> wrote:

Hello All,


I am running quantile regression for a complex survey design and am running the following code:

newdf<-withReplicates(df, quote(coef(rq(api00~api99, tau=0.5, weights=.weights))))


This provides me with the theta and SE but I would really like the p-values and residual degrees of freedom.

summary(newdf) function does not work. Does anyone have any idea how to get p-values and rdf?


Thank you for your help,

Mav



[[alternative HTML version deleted]]

______________________________________________
[hidden email]<mailto:[hidden email]> mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.