I have some questions regarding the meta-regression analysis. I have the database on the proportion (Below bubble plot). My advisor asked me to do the polynomial regression. I have two questions: 1- Is it any polynomial regression pattern in this data? 2- I wrote below code but I couldn't get the line, Could you help me? ---------------- res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year, degree=2)) years <- 1989:2016 preds <- predict(res, transf = transf.ilogit, newmods =cbind(years,years^2)) wi <- 0.5/sqrt(data$s2) wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi)) plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient Expectation (%)") lines(years, preds$pred) -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/751d364d/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: Rplot.jpeg Type: image/jpeg Size: 35122 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/751d364d/attachment-0001.jpeg>
[R-meta] A question about meta-regression Analysis
7 messages · Wolfgang Viechtbauer, Michael Dewey, Hamed Kianmehr
Dear Hamed, Please post in plain text format. I cannot see any plot. Either attach it as a separate image file or post it somewhere else and provide a link. As for 2 - If you use poly(), try: preds <- predict(res, transf = transf.ilogit, newmods = unname(poly(years, degree=2))) Best, Wolfgang -----Original Message----- From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Hamed Kianmehr Sent: Friday, 13 July, 2018 16:03 To: r-sig-meta-analysis at r-project.org Subject: [R-meta] A question about meta-regression Analysis I have some questions regarding the meta-regression analysis. I have the database on the proportion (Below bubble plot). My advisor?asked me to do the polynomial?regression. I have two questions: 1- Is it any polynomial regression pattern in this data? 2- I wrote below code but I couldn't get the line, Could you help me? ---------------- res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year, degree=2)) years <- 1989:2016 preds <- predict(res, transf = transf.ilogit, newmods =cbind(years,years^2)) wi <- 0.5/sqrt(data$s2) wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi)) plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient Expectation (%)") lines(years, preds$pred)
Thank you for your response. Please see the attached file regarding the plot. On Fri, Jul 13, 2018 at 12:35 PM, Viechtbauer, Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
Dear Hamed, Please post in plain text format. I cannot see any plot. Either attach it as a separate image file or post it somewhere else and provide a link. As for 2 - If you use poly(), try: preds <- predict(res, transf = transf.ilogit, newmods = unname(poly(years, degree=2))) Best, Wolfgang -----Original Message----- From: R-sig-meta-analysis [mailto:r-sig-meta-analysis- bounces at r-project.org] On Behalf Of Hamed Kianmehr Sent: Friday, 13 July, 2018 16:03 To: r-sig-meta-analysis at r-project.org Subject: [R-meta] A question about meta-regression Analysis I have some questions regarding the meta-regression analysis. I have the database on the proportion (Below bubble plot). My advisor asked me to do the polynomial regression. I have two questions: 1- Is it any polynomial regression pattern in this data? 2- I wrote below code but I couldn't get the line, Could you help me? ---------------- res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year, degree=2)) years <- 1989:2016 preds <- predict(res, transf = transf.ilogit, newmods =cbind(years,years^2)) wi <- 0.5/sqrt(data$s2) wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi)) plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient Expectation (%)") lines(years, preds$pred)
Best Regards, Hamed Kianmehr, Ph.D. Candidate Department of Systems Science and Industrial Engineering The State University of New York at Binghamton -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/78739083/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: Plot.jpg Type: image/jpeg Size: 22748 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/78739083/attachment-0001.jpg>
Thanks. Well, hard to say if these data are suggestive of a quadratic trend based on visual inspection. The test of the coefficient for 'poly(year, 2)2' tells you whether the quadratic model fits significantly better than just the linear model. Best, Wolfgang -----Original Message----- From: Hamed Kianmehr [mailto:hkianme1 at binghamton.edu] Sent: Friday, 13 July, 2018 18:39 To: Viechtbauer, Wolfgang (SP) Cc: r-sig-meta-analysis at r-project.org Subject: Re: [R-meta] A question about meta-regression Analysis ATTACHMENT(S) REMOVED: Plot.jpg Thank you for your response.? Please see the attached?file regarding the plot.?
On Fri, Jul 13, 2018 at 12:35 PM, Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
Dear Hamed, Please post in plain text format. I cannot see any plot. Either attach it as a separate image file or post it somewhere else and provide a link. As for 2 - If you use poly(), try: preds <- predict(res, transf = transf.ilogit, newmods = unname(poly(years, degree=2))) Best, Wolfgang -----Original Message----- From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Hamed Kianmehr Sent: Friday, 13 July, 2018 16:03 To: r-sig-meta-analysis at r-project.org Subject: [R-meta] A question about meta-regression Analysis I have some questions regarding the meta-regression analysis. I have the database on the proportion (Below bubble plot). My advisor?asked me to do the polynomial?regression. I have two questions: 1- Is it any polynomial regression pattern in this data? 2- I wrote below code but I couldn't get the line, Could you help me? ---------------- res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year, degree=2)) years <- 1989:2016 preds <- predict(res, transf = transf.ilogit, newmods =cbind(years,years^2)) wi <- 0.5/sqrt(data$s2) wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi)) plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient Expectation (%)") lines(years, preds$pred) -- Best Regards, Hamed Kianmehr, Ph.D. Candidate Department of Systems Science and Industrial Engineering The State University of New York at Binghamton
Thank you for your prompt response. For the test, do you mean the value of coefficient(s) (attached file)? if yes, how can I find it better than rest of them? On Fri, Jul 13, 2018 at 1:02 PM, Viechtbauer, Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:
Thanks. Well, hard to say if these data are suggestive of a quadratic trend based on visual inspection. The test of the coefficient for 'poly(year, 2)2' tells you whether the quadratic model fits significantly better than just the linear model. Best, Wolfgang -----Original Message----- From: Hamed Kianmehr [mailto:hkianme1 at binghamton.edu] Sent: Friday, 13 July, 2018 18:39 To: Viechtbauer, Wolfgang (SP) Cc: r-sig-meta-analysis at r-project.org Subject: Re: [R-meta] A question about meta-regression Analysis ATTACHMENT(S) REMOVED: Plot.jpg Thank you for your response. Please see the attached file regarding the plot. On Fri, Jul 13, 2018 at 12:35 PM, Viechtbauer, Wolfgang (SP) < wolfgang.viechtbauer at maastrichtuniversity.nl> wrote: Dear Hamed, Please post in plain text format. I cannot see any plot. Either attach it as a separate image file or post it somewhere else and provide a link. As for 2 - If you use poly(), try: preds <- predict(res, transf = transf.ilogit, newmods = unname(poly(years, degree=2))) Best, Wolfgang -----Original Message----- From: R-sig-meta-analysis [mailto:r-sig-meta-analysis- bounces at r-project.org] On Behalf Of Hamed Kianmehr Sent: Friday, 13 July, 2018 16:03 To: r-sig-meta-analysis at r-project.org Subject: [R-meta] A question about meta-regression Analysis I have some questions regarding the meta-regression analysis. I have the database on the proportion (Below bubble plot). My advisor asked me to do the polynomial regression. I have two questions: 1- Is it any polynomial regression pattern in this data? 2- I wrote below code but I couldn't get the line, Could you help me? ---------------- res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year, degree=2)) years <- 1989:2016 preds <- predict(res, transf = transf.ilogit, newmods =cbind(years,years^2)) wi <- 0.5/sqrt(data$s2) wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi)) plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient Expectation (%)") lines(years, preds$pred) -- Best Regards, Hamed Kianmehr, Ph.D. Candidate Department of Systems Science and Industrial Engineering The State University of New York at Binghamton
Best Regards, Hamed Kianmehr, Ph.D. Candidate Department of Systems Science and Industrial Engineering The State University of New York at Binghamton -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/bc2c04c2/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: Poly degree 3.png Type: image/png Size: 30998 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/bc2c04c2/attachment-0002.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: Poly-degree 2.png Type: image/png Size: 29245 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180713/bc2c04c2/attachment-0003.png>
1 day later
Dear Hamed If the line is supposed to show a polynomial of degree two then to my eyes it does not. It looks linear. If you think there may be a quadratic term why do you not fit two models, a linear on and a quadratic one, and just compare them with anova()? Most of the points on your plot lie on one side of the line (above) which does not look quite right. Michael
On 13/07/2018 17:38, Hamed Kianmehr wrote:
Thank you for your response.
Please see the attached?file regarding the plot.
On Fri, Jul 13, 2018 at 12:35 PM, Viechtbauer, Wolfgang (SP)
<wolfgang.viechtbauer at maastrichtuniversity.nl
<mailto:wolfgang.viechtbauer at maastrichtuniversity.nl>> wrote:
Dear Hamed,
Please post in plain text format. I cannot see any plot. Either
attach it as a separate image file or post it somewhere else and
provide a link.
As for 2 - If you use poly(), try:
preds <- predict(res, transf = transf.ilogit, newmods =
unname(poly(years, degree=2)))
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis
[mailto:r-sig-meta-analysis-bounces at r-project.org
<mailto:r-sig-meta-analysis-bounces at r-project.org>] On Behalf Of
Hamed Kianmehr
Sent: Friday, 13 July, 2018 16:03
To: r-sig-meta-analysis at r-project.org
<mailto:r-sig-meta-analysis at r-project.org>
Subject: [R-meta] A question about meta-regression Analysis
I have some questions regarding the meta-regression analysis. I have
the database on the proportion (Below bubble plot). My advisor?asked
me to do the polynomial?regression. I have two questions:
1- Is it any polynomial regression pattern in this data?
2- I wrote below code but I couldn't get the line, Could you help me?
----------------
res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year,
degree=2))
years <- 1989:2016
preds <- predict(res, transf = transf.ilogit, newmods
=cbind(years,years^2))
wi <- 0.5/sqrt(data$s2)
wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi))
plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient
Expectation (%)")
lines(years, preds$pred)
--
Best Regards,
Hamed Kianmehr, Ph.D. Candidate
Department of Systems Science and Industrial Engineering
The State University of New York at Binghamton
_______________________________________________ R-sig-meta-analysis mailing list R-sig-meta-analysis at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
Thank you very much, Michael. So, I'll look into it with anova. What does it mean " Most of the points on your plot lie on one side of the line (above) which does not look quite right."? is there any way to fix it? On Sun, Jul 15, 2018 at 12:07 PM, Michael Dewey <lists at dewey.myzen.co.uk> wrote:
Dear Hamed If the line is supposed to show a polynomial of degree two then to my eyes it does not. It looks linear. If you think there may be a quadratic term why do you not fit two models, a linear on and a quadratic one, and just compare them with anova()? Most of the points on your plot lie on one side of the line (above) which does not look quite right. Michael On 13/07/2018 17:38, Hamed Kianmehr wrote:
Thank you for your response.
Please see the attached file regarding the plot.
On Fri, Jul 13, 2018 at 12:35 PM, Viechtbauer, Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl <mailto:
wolfgang.viechtbauer at maastrichtuniversity.nl>> wrote:
Dear Hamed,
Please post in plain text format. I cannot see any plot. Either
attach it as a separate image file or post it somewhere else and
provide a link.
As for 2 - If you use poly(), try:
preds <- predict(res, transf = transf.ilogit, newmods =
unname(poly(years, degree=2)))
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis
[mailto:r-sig-meta-analysis-bounces at r-project.org
<mailto:r-sig-meta-analysis-bounces at r-project.org>] On Behalf Of
Hamed Kianmehr
Sent: Friday, 13 July, 2018 16:03
To: r-sig-meta-analysis at r-project.org
<mailto:r-sig-meta-analysis at r-project.org>
Subject: [R-meta] A question about meta-regression Analysis
I have some questions regarding the meta-regression analysis. I have
the database on the proportion (Below bubble plot). My advisor asked
me to do the polynomial regression. I have two questions:
1- Is it any polynomial regression pattern in this data?
2- I wrote below code but I couldn't get the line, Could you help me?
----------------
res<-rma(yi=y, vi=s2, data=data, method="DL",mods = ~ poly(year,
degree=2))
years <- 1989:2016
preds <- predict(res, transf = transf.ilogit, newmods
=cbind(years,years^2))
wi <- 0.5/sqrt(data$s2)
wi <- 0.5 + 3.0 * (wi - min(wi))/(max(wi) - min(wi))
plot(data$year, transf.ilogit(y), cex=wi,xlab="Year",ylab="Patient
Expectation (%)")
lines(years, preds$pred)
--
Best Regards,
Hamed Kianmehr, Ph.D. Candidate
Department of Systems Science and Industrial Engineering
The State University of New York at Binghamton
_______________________________________________ R-sig-meta-analysis mailing list R-sig-meta-analysis at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
-- Michael http://www.dewey.myzen.co.uk/home.html
Best Regards, Hamed Kianmehr, Ph.D. Candidate Department of Systems Science and Industrial Engineering The State University of New York at Binghamton [[alternative HTML version deleted]]