similar to: getting the p-value from lm as a list object

Displaying 20 results from an estimated 400 matches similar to: "getting the p-value from lm as a list object"

2009 Feb 28
3
Extract statistics from lm()
Hi, perhaps this question was answered previously however I could not find them. My problem is how how to extract a particular statistic from the result given by lm(). For e.g. 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 <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) >
2005 Apr 04
1
Object item extraction
Hello I am able to extract partial regression coefficients from a fitted model object "model", i.e. model <- lm(var.sel.gkm, weights = count.gkm, data = DATA) summary(model) write.table(model$coef, file = "C:/coef_CO_gkm.txt", row.names = TRUE, col.names = TRUE) I was wondering if anyone could advise me how to extract other object items such as std. error, t-values
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]]
2005 Dec 09
3
retrieving p-values in lm
Dear list, I want to retrieve the p-value of a two-polynomial regression. For a one-polynomial lm I can easily do this with: summary(lm(b~a, data=c)[[4]][[8]]. But how do I find the final p-value in the two-polynomial regression? Under $coefficients I don't find it Any suggestions? Patrick alt <-(2260,2183,2189,1930,2435, 2000,2100,2050,2020,2470, 1700,2310,2090,1560,2060,
2011 Oct 24
3
extract the p value
OK, what is the trick to extracting the overall p value from an lm object? It shows up in the summary(lm(model)) output but I can't seem to extract it: > test2 = apply(aa, 1, function(x) summary(lm(x[,1] ~ 0 + x[,3] + x[,6]))) > test2[[1]] Call: lm(formula = x[, 1] ~ 0 + x[, 3] + x[, 6]) [omitted summary output] F-statistic: 40.94 on 2 and 7 DF, p-value: 0.0001371 It does not seem
2009 Apr 05
4
extract the p value of F statistics from the lm class
Dear R users I have run an regression and want to extract the p value of the F statistics, but I can find a way to do that. x<-summary(lm(log(RV2)~log(IV.m),data=b)) Call: lm(formula = log(RV2) ~ log(IV.m), data = b[[11]]) Residuals: Min 1Q Median 3Q Max -0.26511 -0.09718 -0.01326 0.11095 0.29777 Coefficients: Estimate Std. Error t value Pr(>|t|)
2008 Jul 02
2
spss long labels
Hi, A frequently seen issue with importing SPSS data files, is that R does not import the 'long variable names'. I built a patch on the R-project's foreign module, in order to import the 'long variable names' from SPSS (record 7, subtype 13). To complete the job, I had to expand the "struct variable" definition to have 64 +1 charachters. I'm not aware of side
2008 Dec 13
2
weird pasting of ".value" when list is returned
could someone explain why the name of FPVAL gets " .value" concatenated onto it when the code below is run and temp is returned. I've been trying to figure this out for too long. It doesn't matter when I put the FPVAL in the return statement. It happens regardless of whether it's first or last. Thanks. f.lmmultenhanced <- function(response, pred1, pred2) {
2008 May 15
2
plot(summary) within quantreg package
Quantreg package allows to plot the summary of models derived by quantile regression at different taus. The plot shows the parameters variation by varying taus: intercept and slope (for a linear model). Together with these values even confidence intervals may be plotted, based on the threshold given within the summary (e.g. alpha=0.01 equals 99% CI). However the graphic even plots the mean of
2009 Oct 13
2
Linear Regression Question
Dear Sir or Madam, I am a student at MSc Probability and Finance at Paris 6 University/ Ecole Polytechnique. I am using R and I can't find an answer to the following question. I will be very thankful if you can answer it. I have two vectors rendements_CAC40 and rendements_AlcatelLucent. I use the lm function as follows, and then the sumarry function: regression=lm(rendements_CAC40 ~
2005 Sep 09
2
best way to fit a model
Hi, I have some data that have this behaviour: | |******* | * | * | * | * |---------------- What is the best and simpler way to fit this in R? Thanks Ronaldo -- Ela pilotava um Continenal 2001 com igni????o autom??tica Magiclic... -- |> // | \\ [***********************************] | ( ?? ?? ) [Ronaldo Reis J??nior ] |>
2011 Sep 28
2
apply lm function to dataset split by two variables
Dear all, I am not fluent in R and am struggling to 1) apply a lm to a weight-size dataset, thus the model has to run separately for each species, each year; 2) extract coefs, r-squared, n, etc. The data look like this: year sps cm w 2009 50 16 22 2009 50 17 42 2009 50 18 45 2009 51 15 45 2009 51 16 53 2009 51 17 73 2010 50 15 22 2010 50 16 41 2010 50 16 21 2010
2010 Apr 26
1
Error in pf(q, df1, df2, lower.tail, log.p) : Non-numeric argument to mathematical function
inputfille snpid indid genotype gvariable probeid gene geneexpression rs1040480 CHB_NA18524 C/T 2 GI_19743926-I PTPRT 5.850586 rs1040480 CHB_NA18526 C/C 1 GI_19743926-I PTPRT 6.028641 rs1040480 CHB_NA18529 C/C 3 GI_19743926-I PTPRT 5.944392 rs1040481 CHB_NA18532 C/C 1 GI_19743926-I PTPRT 5.938578 rs1040481 CHB_NA18537 C/C 2 GI_19743926-I PTPRT 5.874439 rs1040481 CHB_NA18540 C/C 3 GI_19743926-I
2012 Oct 26
3
regression analysis in R
Dear useRs, i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i would like to know best 10 regression results, if i do regression analysis of dependent vector against the random combination of any 4
2012 Oct 23
2
Export summary from regression output
Hi there, I tried it many times but didn't get it worked. I just want to export the summary of a OLS regression (lm() function) into a csv-file including the "call"-formula", "coefficients", "r-squared", " adjusted r-squared" and "f statistic". I know I can export: write.csv2(Regression_60d_ann$coefficients,
2010 Apr 13
2
liner regression for multiple keys
a1 is the first key in input. second column is x-axis and 3rd is y-axis and 4th is its corresponding key. Now for every key in 1st column I would like to calculate LR that gives p value. I tried to manage with a single key. But my problem is that How could I manage multiple keys in input. Thanx in advance input a1 1 2.5 x a1 2 3.5 x a1 3 4.5 x a1 1 2.6 x a1 2 3.8 x b1 1 4.6 y
2010 Nov 29
1
extracting P values from lm model
Hello I am trying to get out of an lm model the fstatistics, however after I run the model I write > names(Model) and the fstatistic does not appear only these. names(Model) [1] "coefficients" "residuals" "effects" "rank" "fitted.values" [6] "assign" "qr" "df.residual"
2011 Aug 15
2
Extracting information from lm results (multiple model runs)
Just to inform: I posted that before in R-sig-ecology but as it might be interesting also for other useRs, I post it also to the general r-user list: Hello Alexandre, thank you very much. I also found another way to extract summarizing information from lm results over e.g. 1000 repeated model runs: results2 <- t(as.data.frame(results)) summary(results2) Although some questions popped up in
2012 Feb 06
1
ggplot2 geom_polygon fill
Hi everyone, i've been trying to make a special plot with ggplot2, but I can't get it to fill the polygon I'd like to see filled so very very much. I want to display the difference or change in the distribution of the modified Rankin Scale between two groups. mRS is a scale for disability or daily activities competence. It looks like this.
2003 Jul 07
1
P-value for F from summary.lm (was RE: (no subject))
[Please use the subject line!] In the help page for summary.lm, the "Value" section says that the returned object has a component called "fstatistic", which has the F-statistic and the associated numerator and denominator degrees of freedom. You can get the p-value by something like: fstat <- summary(speciallinearmodel)$fstatistic pval <- pf(fstat[1], fstat[2],