Displaying 20 results from an estimated 20000 matches similar to: "lm function"
2007 Aug 24
2
Est of SE of coefficients from lm() function
Dear all R users,
Can anyone tell me how I can get estimate of SE of coefficients from, lm()
function?
I tried following :
x = 1:10
lm(x[-1]~x[-10]-1)$coefficients
Here I got the est. of coefficient, however I also want to get some
"automated" way to get estimate of SE.
Regards,
[[alternative HTML version deleted]]
2007 Dec 05
1
confint for coefficients from lm model (PR#10496)
Full_Name: Christian Lajaunie
Version: 2.5.1
OS: Fedora fc6
Submission from: (NULL) (193.251.63.39)
confint() does not use the appropriate variance term when the design
matrix contains a zero column (which of course should not happen).
Example:
A 10x2 matrix with trivial column 1:
> junk <- data.frame(x=rep(0,10), u=factor(sample(c("Y", "N"), 10, replace=T)))
The
2007 Jan 13
3
Definition of t-value
Hello,
I'd like to ask for the exact definition of the t-value, which R uses in its summaries of a linear model for judging the importance of an independent variable in explaining the dependent variable.
I searched the documentation, some groups, and the web for quite a long time, but the best I could come up with is the following from
www.answers.com/topic/value
which reads:
Measure of
2011 Jan 10
2
Calculating Portfolio Standard deviation
Dear R helpers
I have following data
stocks <- c("ABC", "DEF", "GHI", "JKL")
prices_df <- data.frame(ABC = c(17,24,15,22,16,22,17,22,15,19),
DEF = c(22,28,20,20,28,26,29,18,24,21),
GHI = c(32,27,32,36,37,37,34,23,25,32),
2011 Aug 16
4
a question about lm on t-test.
Hi all:
I have a question about lm on t-test.
data(sleep)
I wanna perform t-test to test the difference between the 2 groups:
I can use:
t.test(extra~group)
The t.test result shows that:t = -1.8608; mean1=0.75,mean2=2.33
But I still wanna use:
summary(lm(extra~group))
Intercept=0.75,which is mean1,just the same as t.test.
group2=1.58 means the difference of the 2 groups,so
2011 Mar 31
2
fit.mult.impute() in Hmisc
I tried multiple imputation with aregImpute() and
fit.mult.impute() in Hmisc 3.8-3 (June 2010) and R-2.12.1.
The warning message below suggests that summary(f) of
fit.mult.impute() would only use the last imputed data set.
Thus, the whole imputation process is ignored.
"Not using a Design fitting function; summary(fit)
will use standard errors, t, P from last imputation only.
Use
2010 Aug 11
3
extracting the standard error in lrm
Hi,
I would like to extract the coefficients of a logistic regression
(estimates and standard error as well) in lrm as in glm with
summary(fit.glm)$coef
Thanks
David
2013 May 01
2
significantly different from one (not zero) using lm
Hello,
I am work with a linear regression model:
y=ax+b with the function of lm.
y= observed migration distance of butterflies
x= predicted migration distance of butterflies
Usually the result will show
if the linear term a is significantly different from zero based on the
p-value.
Now I would like to test if the linear term is significantly different from
one.
(because I want to know
2012 Apr 26
2
Lambert (1992) simulation
Hi,
I am trying to replicate Lambert (1992)'s simulation with zero-inflated
Poisson models. The citation is here:
@article{lambert1992zero,
Author = {Lambert, D.},
Journal = {Technometrics},
Pages = {1--14},
Publisher = {JSTOR},
Title = {Zero-inflated {P}oisson regression, with an application to defects
in manufacturing},
Year = {1992}}
Specifically I am trying to recreate Table 2. But my
2009 Oct 21
2
linear regression: Is there a way to get the results of lm as variables
Hi R users
I used R to get the results of a linear regression
reg<-lm(y~x)
here are the results:
# Call:
# lm(formula = donnees$txi7098 ~ donnees$txs7098)
#
# Residuals:
# Min 1Q Median 3Q Max
#
2013 Apr 05
1
white heteroskedasticity standard errors NLS
Hello
Is there any function to calculate White's standard errors in R in an NLS
regression.
The sandwich and car package do it but they need an lm object to calculate
the error's.
Does anyone have idea how to do it for an NLS object ?
Regards
The woods are lovely, dark and deep
But I have promises to keep
And miles before I go to sleep
And miles before I go to sleep
-----
[[alternative
2012 Oct 13
1
hep on arithmetic covariance conversion to log-covariance
Dear All,
is there a function in R that would help me convert a covariance matrix built based on arithmetic returns to a covariance matrix from log-returns?
As an example of the means and covariance from arithmetic:
mu <-c(0.094,0.006,1.337,1.046,0.263)
sigma
2010 Aug 05
3
How to extract se(coef) from cph?
Hello,
I am modeling some survival data wih cph (Design). I have modeled a predictor
which showed non linear effect with restricted cubic splines. I would like to
retrieve the se(coef) for other, linear, predictors. This is just to make nice
LateX tables automatically. I have the coefficients with coef().
How do I do that?
Thanks,
David Biau.
[[alternative HTML version deleted]]
2000 Sep 20
1
lag() and lm()
Hi,
I am using R interactively for estimation and even data manipulation. I want
to use lag() function within lm() function in a way looks like:
mymodel<- lm(y~x+I(lag(y,-1)-1, data=anydata)
What I get is always perfect fit; (that is, coefficient=1) which is not
true.
If the model looks like
mymodel<- lm(y~z+x+I(lag(x,-1)-1, data=anydata)
summary returns only one coefficient for x and
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],
2024 Apr 23
1
System GMM yields identical results for any weighting matrix
A copy of this question can be found on Cross Validated:
https://stats.stackexchange.com/questions/645362
I am estimating a system of seemingly unrelated regressions (SUR) in R.
Each of the equations has one unique regressor and one common regressor. I
am using `gmm::sysGmm` and am experimenting with different weighting
matrices. I get the same results (point estimates, standard errors and
2006 Jan 10
1
extracting coefficients from lmer
Dear R-Helpers,
I want to compare the results of outputs from glmmPQL and lmer analyses.
I could do this if I could extract the coefficients and standard errors
from the summaries of the lmer models. This is easy to do for the glmmPQL
summaries, using
> glmm.fit <- try(glmmPQL(score ~ x*type, random = ~ 1 | subject, data = df,
family = binomial), TRUE)
> summary(glmmPQL.fit)$tTable
2007 Oct 23
2
Using a data frame in a function call
Hi,
I am writing a basic function to extract the z scores for some linear
regression coefficients:
zscore<-function( y, x) {
lm<-lm( y ~ x )
z <- coef(lm)/sqrt(diag(vcov(lm)))
return(z)
}
I would like to pass a dataframe to the function as a argument so the
function call changes from
zscore(df$y1,df$x1)
to
zscore(y1,x1,data=df)
but I am not sure how to reference the data
2010 Aug 18
5
Linear regression equation and coefficient matrix
Hi,
I have 20*60 data matrix (with some NAs) and I wish to perfom a Pearson
correlation coefficient matrix as well as simple linear regression equation
and coefficient of determination (R2) for every possible combination. Any
tip/idea/library/script how do to so.
Thanks,
As hz
--
View this message in context:
2011 May 22
1
How to calculate confidence interval of C statistic by rcorr.cens
Hi,
I'm trying to calculate 95% confidence interval of C statistic of
logistic regression model using rcorr.cens in rms package. I wrote a
brief function for this purpose as the followings;
CstatisticCI <- function(x) # x is object of rcorr.cens.
{
se <- x["S.D."]/sqrt(x["n"])
Low95 <- x["C Index"] - 1.96*se
Upper95 <- x["C