similar to: Extract statistics from lm()

Displaying 20 results from an estimated 300 matches similar to: "Extract statistics from lm()"

2008 Jul 16
1
Output design question
Dear R-helpers, I was curious why the output of summary (and many other functions in R) does not add a separator between the name of a factor and the label of a level (e.g., in the example below, 'group Trt'). If the user had lower case labels (e.g., 'trt'), the output would be particularly hard to read. ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt
2008 Jul 03
1
*** significance with xtable
Hello everybody, i used xtable to get some latex output, which worked pretty well with my latex document. But somewhere i missed the part where they explain how to get these nice significance indicating *** into my latex table. it just stops right after Pr(> |t|) thanks in advance matthias
2013 Feb 19
1
Small quirks in summary.(g)lm docs
Hi! In R 3.0.0 from current SVN, ?summary.lm says: > Value [...] > df degrees of freedom, a 3-vector (p, n-p, p*), the last > being the number of non-aliased coefficients. ?summary.glm says: > df a 3-vector of the rank of the model and the number of residual > degrees of freedom, plus number of non-aliased coefficients. It seems to me that the description is reversed: p is
2007 May 10
1
t value two.sided and one.sided
Hi, on a > summary(lm(y~x)) are the computed t-values for two.sided or one.sided. By looking on some tables they seem like they are for two.sided. Is it possible to have them for one.sided? If this makes sense... Thanks. [[alternative HTML version deleted]]
2010 Dec 02
2
How to call R-squared values from lm's?
I would like to call both p-values and R-squared values from lm's in a function. I can get the p-values from coef(summary(name.lm))[r,c], however, I cannot figure out how to call the R-squared values without manually calling the summary and inserting them in the script - which negates the value of automating the process through a function. Thanks, Mike [[alternative HTML version deleted]]
2008 Oct 31
3
getting the p-value from lm as a list object
Hi, I'm trying to get the p-value from the 'lm' regression function as a list object. For example, I can get r^2 from the following code by entering summary(fm)$r.squared. Is there a way to get the p-value? If not, is there a function where I can enter the f-value and degrees of freedom to get the p-value? Thanks. x <- c(1,2,3,4,5,6,7,8,9,10) y <- c(1,2,3,4,4,5,6,8,1,9) fm
2007 Oct 02
5
Linear Regression
Hello, I would like to fit a linear regression and when I use summary(), I got the following result: Call: lm(formula = weight ~ group - 1) Residuals: Min 1Q Median 3Q Max -1.0710 -0.4938 0.0685 0.2462 1.3690 Coefficients: Estimate Std. Error t value Pr(>|t|) groupCtl 5.0320 0.2202 22.85 9.55e-15 *** groupTrt 4.6610 0.2202 21.16 3.62e-14
2010 Jul 14
1
Add Significance Codes to Data Frame
I was hoping that there might be some way to attach significance code like the ones from summary.lm to a dataframe. Anyone know how to do something like that. Here is the function i'd like to add that functionality to: add1.coef <- function(model,scope,test="F",p.value=1,order.by.p=FALSE) { num <- length(model$coefficients) add <- add1(model,scope,test=test) sub <-
2014 Sep 26
2
summary
Grandiosa Comunidad Saludos Quiero pedirles ayuda en los siguientes puntos; .- Pregunto si puedo sacar, aumentarle al summary también los siguientes puntos Intervalo de confianza, desviación estándar? .- como puedo obtener la correlación en variables dicotómicas ej. tau de kendall? .- Como puedo cambiar los títulos del ingles al español de los encabezados de un surfit(Surv(tiempo, estado))? --
2005 Jul 28
1
Displaying p-values in latex
Hi. I want to create a table in latex with regression coefficients and their corresponding p-values. My code is below. How do I format the p-values so that values less than 0.0001 are formated as <.0001 rather than just rounded to 0.0000? Thank you. model<-lm(y~x1+x2) output<-summary(model) output<-as.matrix(coefficients(output)) output<-format.df(ouput,cdec=c(2,2,2,4))
2008 Dec 23
1
sorting regression coefficients by p-value
Hi, Is there a way to get/extract a matrix of regression variable name, coefficient, and p values? (for lm and glm; which can be sort by p value?) thanks Dhruv [[alternative HTML version deleted]]
2005 Sep 29
5
Regression slope confidence interval
Hi list, is there any direct way to obtain confidence intervals for the regression slope from lm, predict.lm or the like? (If not, is there any reason? This is also missing in some other statistics softwares, and I thought this would be quite a standard application.) I know that it's easy to implement but it's for explanation to people who faint if they have to do their own programming...
2006 Jun 21
1
Extract information from the summary of 'lm'
Hi Everyone, I just don't know how to extract the information I want from the summary of a linear regression model fitting. For example, I fit the following simple linear regression model: results = lm(y_var ~ x_var) summary(results) gives me: Call: lm(formula = y_var ~ x_var) Residuals: Min 1Q Median 3Q Max -5.9859 -1.5849 0.4574 2.0163 4.6015 Coefficients:
2000 Sep 04
3
somebody's stolen my probabilities
gday gurus, could someone please help me with this one? Can't find it in the doco. summary of my lm object gives "Pr(>|t|)" but coef doesn't. How do I get hold of these probabilities within an object? There doesn't seem to be an appropriate attribute within the object - I was hoping for something like "my.lm$probabilies". I was hoping to grab the best t
2001 Jun 01
1
formulas in variables in modeling functions
I first noticed this in gnls, but it also happens in lm, so I suspect the following phenomenon is universal in modeling functions. Modify the example from the lm help: model <- as.formula(weight ~ group) lm(model) The result will be printed: > lm(model) Call: lm(formula = model) ^^^^^^^^^^^^^^^^^ Coefficients: (Intercept) groupTrt 5.032 -0.371 This is because in lm,
2007 Mar 09
2
Extracting the p of F statistics from lm
I need to extract the p value from a ANOVA done with lm model fitting <- lm(var ~ group) Sfitting <- summary(fitting) Sfitting[10][1] gives the F value and the degrees of freedom but I am not able to get the p value. The function df should give a p value given a F but I am not able to make it work. I found only something about aov in the R help and I am not able to make it work Massimo
2011 Aug 31
3
Converting anova/ancova summary to data frame
Hi! Can anyone tell me how to convert the anova/ancova summary output into a data frame? Thanks! Shane Phillips [[alternative HTML version deleted]]
2006 Nov 09
1
Extracting the full coefficient matrix from a gls summary?
Hi, I am trying to extract the coefficients matrix from a gls summary. Contrary to the lm function, the command fit$coefficients returns only the estimates of the model, not the whole matrix including the std errors, the t and the p values. example: ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <-
2013 Nov 29
2
Listas en R
Hola. Me interesa meter una serie de regresiones lineales en una lista a la que voy a denominar L. El problema es que a posteriori necesito sacar valores de esas regresiones. Sin embargo, al llamar a L[1] este no es un objeto del tipo "lm" sino que es del tipo "list" y no puedo aplicarle funciones relacionadas con la regresión (tal y como puede ser hacer un summary para
2010 Jun 13
1
Standard error of regression coefficient
Hi all, This should be a very simple question for you, whereas it is proving devilish for me. How do I output the STANDARD ERROR of the regression coefficient (i.e., the standard error of b) from a simple linear regression? Consider this data, taken directly from ?lm: ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)