Displaying 20 results from an estimated 12000 matches similar to: "Marginal effects from interaction regression model"
2003 Jul 30
2
Comparing two regression slopes
Hello,
I've written a simple (although probably overly roundabout) function to
test whether two regression slope coefficients from two linear models on
independent data sets are significantly different. I'm a bit concerned,
because when I test it on simulated data with different sample sizes and
variances, the function seems to be extremely sensitive both of these. I am
wondering if
2006 May 06
2
How to test for significance of random effects?
Dear list members,
I'm interested in showing that within-group statistical dependence is
negligible, so I can use ordinary linear models without including random
effects. However, I can find no mention of testing a model with vs.
without random effects in either Venable & Ripley (2002) or Pinheiro and
Bates (2000). Our in-house statisticians are not familiar with this,
either,
2001 Feb 23
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
Using a formula converted with as.formula with lme leads
to an error message. Same works ok with lm, and with
lme and a fixed formula.
# demonstrates problems with lme and as.formula
demo<-data.frame(x=1:20,y=(1:20)+rnorm(20),subj=as.factor(rep(1:2,10)))
demo.lm1<-lme(y~x,data=demo,random=~1|subj)
print(summary(demo.lm1))
newframe<-data.frame(x=1:5,subj=rep(1,5))
2005 Aug 12
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
This is a continuing issue with the one on the list a long time ago (I
couldn't find a solution to it from the web):
--------------------------------------------------------------------------
> Using a formula converted with as.formula with lme leads
> to an error message. Same works ok with lm, and with
> lme and a fixed formula.
>
> # demonstrates problems with lme and
2007 Aug 06
1
test the significances of two regression lines
R-help,
I'm trying to test the significance of two regression lines
, i.e. the significance of the slopes from two samples
originated from the same population.
Is it correct if I fit a liner model for each sample and
then test the slope signicance with 'anova'. Something like this:
lm1 <- lm(Y~ a1 + b1*X) # sample 1
lm2 <- lm(Y~ a2 + b2*X) # sample 2
anova(lm1, lm2)
2010 Jun 17
1
Problems using allEffects() (package effect)
Dear R users,
I have some trouble using the allEffects() function to compute and
display effect plots for a linear model.
My data is quite simple, it concerns effects of 3 treatments on the
tumoral volume of mice. vTum codes for the qualitative initial volume,
from small to big, temps is the time in month since beginning of
treatment, and S?rie codes for the batch. Data is unbalanced.
>
2013 Apr 11
1
Calculating std errors of marginal effects in interactions
Hi! I've been looking for a way to calculate std errors of marginal effects
when I use interaction terms, but with no success. I pretty much have two
cases: continuous variable * continuous variable, and continuous variable *
binary variable. In both cases, I know how to calculate the marginal
effects, even with simulation.
But I still can't figure out how to calculate the std errors of
2013 Mar 18
1
try/tryCatch
Hi All,
I have tried every fix on my try or tryCatch that I have found on the
internet, but so far have not been able to get my R code to continue with
the "for loop" after the lmer model results in an error.
Here is two attemps of my code, the input is a 3D array file, but really
any function would do....
metatrialstry<-function(mydata){
a<-matrix(data=NA, nrow=dim(mydata)[3],
2011 Aug 23
0
Marginal Effects for Beta Regression
Hi,
Im just doing some Beta-Regressions with the betareg package. My question is
now, is there a possibility
to calculate the marginal effects with the betareg package or is there
another package which can handle marginal effects on regression output for
the "beta" class?
I try to calculate the marginal effects also by hand but then i have the
problems with the standard errors :-(
Thx
2011 Apr 25
0
probit regression marginal effects
Dear R-community,
I am currently replicating a study and obtain mostly the same results as the author. At one point, however, I calculate marginal effects that seem to be unrealistically small. I would greatly appreciate if you could have a look at my reasoning and the code below and see if I am mistaken at one point or another.
My sample contains 24535 observations, the dependent variable
2005 Mar 09
1
multiple comparisons for lme using multcomp
Dear R-help list,
I would like to perform multiple comparisons for lme. Can you report to me
if my way to is correct or not? Please, note that I am not nor a
statistician nor a mathematician, so, some understandings are sometimes
quite hard for me. According to the previous helps on the topic in R-help
list May 2003 (please, see Torsten Hothorn advices) and books such as
Venables &
2006 Nov 30
1
data.frame within a function (PR#9294) (cont'd)
This continues the message "data.frame within a function (PR#9294)" that
was posted on 2006/10/12. Duncan Murdoch kindly replied. I'm using the
current version R 2.4.0, but the same issue exists. Just copy and paste
the following code under R, and compare the output of f1() and f2() and
the output of f3() and f4(). Does anybody have any idea? Thanks.
2008 Sep 17
2
Command Prompt Question
Could someone please tell me how to stop the package/function name from
being included before the command prompt? This started happening today
after I made some changes to my Rprofile.site file and I don't know why.
For example: if I enter example(AIC), instead of just getting the
regular '>' before each output line, I get 'AIC>' instead. I only want
the '>'
2008 Jun 04
1
Comparing two regression lines
Dear R users,
Suppose I have two different response variables y1, y2 that I regress separately on the same
explanatory variable, x; sample sizes are n1=n2.
Is it legitimate to compare the regression slopes (equal variances assumed) by using
lm(y~x*FACTOR),
where FACTOR gets "y1" if y1 is the response, and "y2" if y2 is the response?
The problem I see here is that the
2012 May 22
1
Adding Text to a Plot
Hi, all!
I'm pretty sure I'm missing something about this.
Is there a smart way of typping hat(R)^2 and it's value from a linear
regression?
I've just found this tricky one:
# Sample data
x <- sample(1:100,10)
y <- 2+3*x+rnorm(10)
# Run the regression
lm1 <- lm(y~x)
# Plotting
plot(x,y, main="Linear Regression", col="red")
2005 May 31
2
simple predict question
Excuse the simple question...
I'm not sure what I'm doing wrong with predict, but let me use this example:
Suppose I do:
dat<-matrix(c(0,0,10,20),2,byrow=T)
lm1<-lm(dat[,2]~dat[,1])
Suppose I want to generate the linearly-interpolated y-values between the
point (0,0) and (0,20) at every unit interval.
I thought I just do:
predict(lm1, data.frame(seq(0,10,1))) to get
2013 Jan 18
1
Object created within a function disappears after the function is run
Dear R-helpers,
I have run the code below which I expected to make an object called dd1,
but that object does not exist.
So, in summary, my problem is that my function is meant to make an object
(dd1), and it does indeed make that object (I know that the last line of
the function prints it out) but then, after the function has run, the
object has disappeared.
It's late on a Friday so I may
2010 Oct 12
1
delta AIC for models with 2 variables using MuMIn
Dear List,
I want to ask a AIC question based on package library(MuMIn)
The relative importance of 16 explanatory variables
are assessed using delta AIC in a generalized linear model.
Please kindly advise if it is possible to show models
with any two only certain variables.
Thank you.
Elaine
I asked a similar question and got a great help for models
with only one variable as below.
2010 Aug 17
2
how to selection model by BIC
Hi All:
the package "MuMIn" can be used to select the model based on AIC or AICc.
The code is as follows:
data(Cement)
lm1 <- lm(y ~ ., data = Cement)
dd <- dredge(lm1,rank="AIC")
print(dd)
If I want to select the model by BIC, what code do I need to use? And when
to select the best model based on AIC, what the differences between the
function "dredge" in
2007 Jun 26
1
Marginal Effects of continuous variable in lrm model (Design package)
Dear all:
When I am trying to get the marginal effects:
summary(result7,adv_inc_ratio=mean(m9201
$adv_inc_ratio),adv_price_ratio=mean(m9201$adv_price_ratio), ...(SOME
MORE CONTINUOUS AND DISCRETE VARIABLES BUT I AM NOT LISTING)... regW=c
(0,mean(m9201$regW),1), regWM=c(0,mean(m9201$regWM),1))
It gave out an error message:
Error in summary.Design(result7, adv_inc_ratio = mean(m9201