Displaying 20 results from an estimated 200 matches similar to: "renaming intercept column when retrieving coeficients from lme using coef function"
2009 May 18
1
error in importing text files
Hello All:
I am very new to R and am trying to import some (107) text files into R while simultaneously manipulating the data into a structure that I can use. Below is a description of what I am trying to ultimately accomplish. However, I find that I am unable to even read one file into R using the read.table function. I get the following error:
> test<-read.table("test4.txt")
2009 May 19
2
Using while statements to insert rows in a dataframe
Hi.
I am very new to R and have been diligently working my way through the manual and various tutorials. I am now trying to work with some of my own data and have encountered a problem that I need to fix. I have a dataframe with 8 columns and approximately 850 rows. I have provided an excerpt of the dataframe below. Within column 6 (Question) the numbers 1:33 repeat down the entire column.
2004 Nov 08
1
plotting lm coeficients with their means
I am trying to write a function that will run a linear
model and plot the regression coeficients with their
corresponding means. I am having two problems. I can
get the plot with the function below, but I am having
trouble labeling the points.
function(y,x1,x2,x3,x4){
outlm<-lm(y~x1+x2+x3+x4)
imp<-as.data.frame(outlm$coef[-1])
meanvec<-c(mean(x1),mean(x2),mean(x3),mean(x4))
2013 May 08
1
How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?
Hi!
I am trying to calculate HPD for the coeficients of regression models
fitted with lm or lmrob in R, pretty much in the same way that can be
accomplished by the association of mcmcsamp and HPDinterval functions for
multilevel models fitted with lmer. Can anyone point me in the right
direction on which packages/how to implement this?
Thanks for your time!
R.
[[alternative HTML version
2017 Dec 06
2
Coeficients estimation in a repeated measures linear model
Dear Users,
I am trying to understand the inner workings of a repeated measures linear
model. Take for example a situation with 6 individuals sampled twice for
two conditions (control and treated).
set.seed(12)
ctrl <- rnorm(n = 6, mean = 2)
ttd <- rnorm(n = 6, mean = 10)
dat <- data.frame(vals = c(ctrl, ttd),
group = c(rep("ctrl", 6), rep("ttd",
2008 Jan 24
2
testing coeficients of glm
Dear list,
i'm trying to test if a linear combination of coefficients of glm is equal
to 0. For example :
class 'cl' has 3 levels (1,2,3) and 'y' is a response variable. We want to
test H0: mu1 + mu2 - mu3 =0 where mu1,mu2, and mu3 are the means for each
level.
for me, the question is how to get the covariance matrix of the estimated
parameters from glm. but perhaps there
2003 Jun 25
2
within group variance of the coeficients in LME
Dear listers,
I can't find the variance or se of the coefficients in a multilevel model
using lme.
I want to calculate a Chi square test statistics for the variability of the
coefficients across levels. I have a simple 2-level problem, where I want to
check weather a certain covariate varies across level 2 units. Pinheiro
Bates suggest just looking at the intervals or doing a rather
2008 Jul 07
5
question on lm or glm matrix of coeficients X test data terms
Hi,
is there an easy way to get the calculated weights in a regression equation?
for e.g.
if my model has 2 variables 1 and 2 with coefficient .05 and .6
how can I get the computed values for a test dataset for each coefficient?
data
var1,var2
10,100
so I want to get .5, 60 back in a vector. This is a one row example but I would want to get a matrix of multiplied out coefficients
2006 Aug 07
2
Constrain coefs. in linear model to sum to 0
Hello!
I would like to use constrain to sum coeficients of a factor to 0 instead
of classical corner contraint i.e. I would like to fit a model like
lm(y ~ 1 + effectA + effectB)
and say get parameters
intercept
effectA_1
effectA_2
effectB_1
effectB_2
effectB_3
where effectA_1 represents deviation of level A_1 from intercept and
sum(effectA_1, effectA_2) = 0 and the same for factor B.
Is
1999 Apr 30
1
Question on the idiom: start <- coef; start[fit$pivot] <- coef
I wonder if someone could explain how the following R idiom works (it's
used in
glm.fit).
start <- coef
start[fit$pivot] <- coef
coef is a vector of coefficients, set by .Fortran("dqrls", ...).
fit$pivot is a vector of integer indexes (indicating how dqrls permuted
the columns
of x). If coef has n elements, fit$pivot is a permutation of seq(1,5).
start[fit$pivot]
2017 Nov 07
0
New vcov(*, complete=TRUE) etc -- coef(<lm>) vs coef(<aov>)
Dear Martin,
I think that your plan makes sense. It's too bad that aov() behaved differently in this respect from lm(), and thus created more work, but it's not be a bad thing that the difference is now explicit and documented.
I expect that that other problems like this will surface, particularly with contributed packages (and I know that you're aware that this has already happened
2009 Jun 07
1
One rather theoretical question about fitting algorithm
Hi,
What I'm trying to achieve is very fast algorithm for fitting logistic
regression model. I have to estimate regression coeficients using
about 10k observations. Once I have coefficients estimated, new 100
rows of data becomes available.... Now I need to reestimate
coeficients using 100 newly arrived observations and removing 100
oldest observations.
So, my question is would it be
2007 Feb 21
1
simple question on one-sided p-values for coef() on output of lm()
Dear list,
I was wondering if it is possible to get the p-values for one-sided tests on the parameters of a linear regression.
For instance, I use lm() and store the result in an object. lm() gives me a matrix, using summary() and coef() on which gives me a matrix containing the coefficients, the standard errors, the t-statistics and the two-sided p-values by default. Can I get it to provide me
2011 Jul 23
2
standard error of exp(coef) from coxph
Dear List,
Must be a silly question, but I was wondering whether there is a direct way of calculating "standard error of a HR or exp(coef)" from coxph objects
x <- coxph(Surv(time, status) ~ age + inst, lung)> x coef exp(coef) se(coef) z page 0.0190 1.02 0.00925 2.06 0.04inst -0.0104 0.99 0.01028 -1.01 0.31
cheers,
Ehsan
[[alternative HTML
2010 Aug 09
2
coef(summary) and plyr
Dear all,
I?m having trouble getting a list of regression variables back into a dataframe.
mydf <- data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100))
mydf$fac<-factor(sample((0:2),replace=T,100))
mydf$y<- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100)
dlply(mydf,.(fac),function(df) lm(y~x1+x2+x3,data=df))->dl
here I?d like to use
ldply(dl,coef(summary)) or something
2010 Jul 06
0
Add1 w/ coef estimates?
I was wondering if there is anyway to have Add1() display the coefficient
estimates for each candidate predictor along with the F test. This is for
lm() btw.
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/Add1-w-coef-estimates-tp2279662p2279662.html
Sent from the R help mailing list archive at Nabble.com.
2007 Mar 16
1
Create coef.table as in summary.glm (with Signif. codes)
Hi,
how do I create a coef.table as for example returned by summary.glm?
I don't see where the significance codes are assigned during summary.glm.
Thank you,
Benjamin
2004 Sep 21
0
Lme warning with coef()
Hello<
I routinely use the following without a problem:
fm1<-lme(score~time,data,random=~time|ID)
tmp<-coef(fm1, augFrame=T)
However, in my current situation, I am running into the following error
when I execute the coef() call
Error in tapply(as.character(object[[nm]]), groups, FUN[[dClass]]) :
arguments must have same length
There are some cases with missing data, but I
2018 May 23
1
coef does not work for my ASReml model
Hi Everyone,
I am using ASReml to fit a spatial model. I do not have all the components
of ASReml when I call;
names(summary())
e.g.
names(summary(fcov.asr2))
[1] "call" "loglik" "nedf" "sigma" "varcomp"
I am trying to get the coefs but I get "NULL".
Does anybody know the reason?
Any help would be much appreciated.
Regards
2007 Aug 07
0
Bug in coef<-.varIdent method (nlme package) (PR#9831)
Hello,
1. It appears that "coef<-.varIdent" method does not work properly in
some instances.
Execution error:
Error in `coef<-.varIdent`(`*tmp*`, value = c(11, 12)) :
Cannot change the length of the varIdent parameter after
initialization
occurs when "coef<-.varIdent" is applied to an initialized object of
class varIdent with some of the coefficients