coefplot

Subset of predictors using coefplot()

只愿长相守 提交于 2019-12-23 22:19:24
问题 I'd like to do a plot of coefficients using coefplot() that only takes into account a subset of the predictors that I'm using. For example, if you have the code y1 <- rnorm(1000,50,23) x1 <- rnorm(1000,50,2) x2 <- rbinom(1000,1,prob=0.63) x3 <- rpois(1000, 2) fit1 <- lm(y1 ~ x1 + x2 + x3) and then ran coefplot(fit1) it would give you a plot displaying the coefficients of the intercept, x1, x2 and x3. How can I modify this so I only get the coefficients for say, x1 and x2? 回答1: You can use the

decreasing coefficients in R's coefplot?

和自甴很熟 提交于 2019-12-11 06:39:14
问题 coefplot from library(coefplot) has a variable decreasing which when set to to TRUE the coefficients should be plotted in descending order But when I run a toy example: data(tips, package = "reshape2") mod1 <- lm(tip ~ day + sex + smoker, data = tips) coefplot.glm(mod2, decreasing = TRUE) the coefficients aren't in descending order. What am I missing? EDIT I was missing sort = "magnitude" . However, this doesn't work with multiplot : data(tips, package = "reshape2") mod1 <- lm(tip ~ day + sex

Plotting same coefficient over time

笑着哭i 提交于 2019-12-01 06:55:52
I am using the coefplot package in Stata to plot how a coefficient changes depending on the model employed. In particular, I want to see how the coefficient of interest changes over time. I am plotting it vertically, so the x-axis could show the year to which each coefficient refers to. However, I am not able to label the x-axis accordingly (instead of showing the name of the variable I am interested, x1 , it should state 1, 2 and 3. I would also like to omit the legend by using the option legend(off) but that does not work. This is the code I am using: reg y x1 x2 if year==1; estimates store

Plotting same coefficient over time

好久不见. 提交于 2019-12-01 04:27:51
问题 I am using the coefplot package in Stata to plot how a coefficient changes depending on the model employed. In particular, I want to see how the coefficient of interest changes over time. I am plotting it vertically, so the x-axis could show the year to which each coefficient refers to. However, I am not able to label the x-axis accordingly (instead of showing the name of the variable I am interested, x1 , it should state 1, 2 and 3. I would also like to omit the legend by using the option