similar to: help with coef

Displaying 20 results from an estimated 20000 matches similar to: "help with coef"

2002 May 21
3
how to extrac one coef from lm at a time
Hello R-Users, I have I simple question that I could not solve: How to extract the elevation and the slope values from a linear model (lm) separately? coef(model.lm) gives both of them. Thanks, Antonio Olinto -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",
2004 Dec 29
1
Discrepancy between intervals.lme and coef.lme
I'm using R on Windows v2.0.1 with the nlme package (v3.1-53) and am finding some unexpected discrepancies in the output of intervals.lme and coef.lme. I've included a toy dataset at the end, but briefly, the data are longitudinal data from couples in marital therapy. Each spouse's relationship satisfaction is measured 4 times; I've fit both linear and quadratic models to the
2010 Sep 29
1
Trying to avoid loop structure
Dear R-helpers, I'm trying to associate linear coefficients (intercept and slope) to tens of thousands of observations based on a table with benchmark values. #####Example - Value table and their corresponding coefficients (intercept and slope) coef = data.frame(cbind(st=c(1:5),b = runif(5,0.3,5),a = seq(0.5,5,1)))print(coef) #Example of observations to be computedobs = runif(20,1,5)print(obs)
2012 Oct 25
2
How to extract auc, specificity and sensitivity
I am running my code in a loop and it does not work but when I run it outside the loop I get the values I want. n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta <- 0 ystar <- intercept+beta*x z <- rbinom(n,1,plogis(ystar)) xerr <- x + rnorm(n,0,tau) model<-glm(z ~ xerr, family=binomial(logit))
2010 Apr 27
3
Problem calculating multiple regressions on a data frame.
Hi there, I am stuck trying to solve what should be a fairly easy problem. I have a data frame that essentially consists of (ID, time as seqMonth, variable, value) and i want to find the regression coefficient of value vs time for each combination of ID and Variable. I have tried several approaches and none of them seems to work as i expected. For example, i have tried:
2010 Apr 19
3
nls for piecewise linear regression not converging to least square
Hi R experts, I'm trying to use nls() for a piecewise linear regression with the first slope constrained to 0. There are 10 data points and when it does converge the second slope is almost always over estimated for some reason. I have many sets of these 10-point datasets that I need to do. The following segment of code is an example, and sorry for the overly precise numbers, they are just
2007 May 02
3
ED50 from logistic model with interactions
Hi, I was wondering if someone could please help me. I am doing a logistic regression to compare size at maturity between 3 seasons. My model is: fit <- glm(Mature ~ Season * Size - 1, family = binomial, data=dat) where Mature is a binary response, 0 for immature, 1 for mature. There are 3 Seasons. The Season * Size interaction is significant. I would like to compare the size at 50%
2012 Oct 20
1
Logistic regression/Cut point? predict ??
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta
2004 Mar 03
3
Adding text (coefts) to pairs panels
Hi, First of all, thanks for the efforts of all the developers and contributors - I'm very new to R and at the moment am just using it to create some graphics, but it seems to be quite powerful. I've googled the archives and wasn't able to find anyhting that dealt with this problem, so would appreciate any suggestions/tips. In a pairs plot I'd like to plot a linear regression line
2010 Jun 27
2
Ways to work with R and Postgres
Hi, I post this message to the general r-help list hoping anyone within a wider range have suggestions: There are three ways to integration R and postgres, especially on 64bit Microsoft windows Platform, 1. via RODBC package, which has 32 bit and 64 bit version for windows 2. via RPostgres interface, which only has 32bit version currently 3. via plr for Greenplum, which only supports a
1998 Jul 13
1
R-beta: accessing SEs from lm object
If I do fit<-lm(y~x) Is it possible to access the SE of the slope? (Analogous to getting the slope like this: fit$coef[2]) If not, it would be handy. (I want SE of 1/slope, and an approx way is fit$se[2]/(fit$coef[2]^2)) Thanks for any help. Bill Simpson -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2009 Apr 03
2
Linear model, finding the slope
Hi for some data I working on I am merely plotting time against temperature for a variable named filmclip. So for example, I have volunteers who watched various film clips and have used infared camera to monitor the temperature on their face at every second of the clip. The variable names I have used are Normalised ( for the temperature) and Frame (for the time in seconds). So I have fitted a
2006 Mar 10
4
How to get the intercept from lm?
Hi I am using R 2.2.0 under SuSE 10 I want to use lm() to get the slope and intercept for several daatasets and store them in a database. So far so good - but how do I extract the slope and the intercept from the result from lm()? my code looks like this: lmNNDens <- lm(log(DensNN$MeanNN) ~ log(DensNN$MeanDensity)) anovaLM <- anova(lmNNDens) Results$slope[No] <- ???lmNNDens???
2012 Nov 06
1
Confidence intervals for Sen slope in zyp-package
Hi, I have a question about the computation of confidence intervals in the zyp package, in particular using the functions zyp.sen and confint.zyp, or zyp.yuepilon. (1) I'm a bit confused about the confidence intervals given by zyp.sen and confint.zyp. When I request a certain confidence interval in the function, the R output seems to deliver another confidence interval, e.g. when I set
2005 Jul 21
1
Question about 'text' (add lm summary to a plot)
I would like to annotate my plot with a little box containing the slope, intercept and R^2 of a lm on the data. I would like it to look like... +----------------------------+ | Slope : 3.45 +- 0.34 | | Intercept : -10.43 +- 1.42 | | R^2 : 0.78 | +----------------------------+ However I can't make anything this neat, and I can't find out how to combine this
2007 Aug 27
2
validate (package Design): error message "subscript out of bounds"
Dear R users I use Windows XP, R2.5.1 (I have read the posting guide, I have contacted the package maintainer first, it is not homework). In a research project on renal cell carcinoma we want to compute Harrell's c index, with optimism correction, for a multivariate Cox regression and also for some univariate Cox models. For some of these univariate models I have encountered an error
2011 Jul 08
2
manipulating "by" lists and "ave()" functions
dear R wizards---more ignorance on my part, exacerbated by too few examples in the function documentations. > d <- data.frame( id=rep(1:3,3), x=rnorm(9), y=rnorm(9)) Question 1: how do I work with the output of "by"? for example, > b <- by( d, d$id, function(x) coef(lm( y ~ x, data=x ) )) > b d$id: 1 (Intercept) x 0.2303 0.3618
2012 Apr 23
2
Problem extracting enough coefs from gam (mgcv package)
Dear useRs, I have used using the excellent mgcv package (version 1.7-12) to create a generalized additive model (gam) including random effects - represented with s(...,bs="re") - on the basis of dialect data. My model contains two random-effect factors (Word and Key - the latter representing a speaker) and I have added both random intercepts and various random slopes for these
2008 Sep 26
3
Regression and data types
Dear All I have three data sets, X1, X2 and Y. X1 is data, X2 and Y were generated in (different) R programs. All three vectors have one column of 60 data points. I am using the code lm(Y~X1)$coef and lm(Y~X2)$coef. The first returns two values, an intercept and a slope, but the second returns 60 values. I suspect there is something in the "type" of X2 such that it forces the regression
2011 Jun 26
1
changing graphs in qqplot2
This is what I have now so far. p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) + geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY) > p +scale_x_continuous(limits=c(1,4)) http://r.789695.n4.nabble.com/file/n3626510/graph.gif I would also like to: 1.) change the headline for the faced wraps ?high? and ?low?. Is there any other way of