similar to: lm: how are polynomial functions interpreted?

Displaying 20 results from an estimated 4000 matches similar to: "lm: how are polynomial functions interpreted?"

2010 Jul 30
2
logos and goodies
I've got a couple questions related to my search (in vain) for an "R" tshirt or coffee mug. The first question is simply: is there a higher-resolution R logo available than the one at r-developer.org? (or the modified one provided by useR conference pages) Next: what are the chances of someone in the "R management" setting up a cafepress.com "R
2003 Apr 29
1
polynomial fitting
I'm trying to find a way to fit a polynomial of degree n in x and y to a set of x, y, and z data that I have and obtain the coefficients for the terms of the fitted polynomial. However, when I try to use the surf.ls function I'm getting odd results. > x <- seq(0, 10, length=50) > y <- x > f <- function (x, y) {x^2 + y} > library(spatial) > test <-
2012 Jan 09
2
Joint confidence interval for fractional polynomial terms
Dear R users, The package 'mfp' that fits fractional polynomial terms to predictors. Example: data(GBSG) f <- mfp(Surv(rfst, cens) ~ fp(age, df = 4, select = 0.05) + fp(prm, df = 4, select = 0.05), family = cox, data = GBSG) print(f) To describe the association between the original predictor, eg. age and risk for different values of age I can plot it the polynomials
2001 Jul 09
1
polynomial regression and poly
When doing polynomial regression I believe it is a good idea to use the poly function to generate orthogonal polynomials. When doing this in Splus there is a handy function (transform.poly I think) to convert the coefficients produced by regression with the poly function back to the original scale. Has somebody written something similar for R ? Robert
2008 Jan 07
3
Polynomial fitting
I wonder how one in R can fit a 3rd degree polynomial to some data? Say the data is: y <- c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x <- seq(3.75, 6, 0.25) And resulting degrees of polynomial are: 5.8007 -91.6339 472.1726 -774.2584 THanks in advance! -- Jonas Malmros Stockholm University Stockholm, Sweden
2004 May 06
5
Orthogonal Polynomial Regression Parameter Estimation
Dear all, Can any one tell me how can i perform Orthogonal Polynomial Regression parameter estimation in R? -------------------------------------------- Here is an "Orthogonal Polynomial" Regression problem collected from Draper, Smith(1981), page 269. Note that only value of alpha0 (intercept term) and signs of each estimate match with the result obtained from coef(orth.fit). What
2010 May 17
2
best polynomial approximation
Dear R-users, I learned today that there exists an interesting topic in numerical analysis names "best polynomial approximation" (BSA). Given a function f the BSA of degree k, say pk, is the polynomial such that pk=arginf sup(|f-pk|) Although given some regularity condition of f, pk is unique, pk IS NOT calculated with least square. A quick google tour show a rich field of research
2009 Dec 08
1
coefficients of each local polynomial from locfit
Hi list, This was asked a couple of years ago but I can't find a resolution. Is there any way to get the coefficients from one of the local polynomial fits in locfit. I realize that locfit only constructs polynomials at a handful of intelligently selected points and uses interpolation to predict any other points. I would like to know the terms of the polynomials at these points. It seems
2003 Jun 23
1
precision matrix for polynomial growth curves
What does the warning message "1: Singular precision matrix in level -1, block 1" mean? I get this warning 50+ times when I try to fit the following model lme( response ~ covariateA + poly(covariateB,3), ~poly(covariateB,3)|group ) It's not a small dataset - a set of up to 20 blood pressure readings on just over 2000 people, and I don't get the error message when I try to fit
2007 Aug 15
1
Polynomial fitting
Hi everybody! I'm looking some way to do in R a polynomial fit, say like polyfit function of Octave/MATLAB. For who don't know, c = polyfit(x,y,m) finds the coefficients of a polynomial p(x) of degree m that fits the data, p(x[i]) to y[i], in a least squares sense. The result c is a vector of length m+1 containing the polynomial coefficients in descending powers: p(x) = c[1]*x^n +
2011 Jun 14
1
functions for polynomial and rational interplation?
Are there implementations of, e.g. Neville's algorithm, for interpolating polynomials through some data points? Nevilles' is an improvement on Lagrange interpolation. And how about interpolating rational functions? I could not find anything at rseek.org or at crantastic.org. thanks -- View this message in context:
2011 Jul 07
1
Polynomial fitting
Hello, i'm fairly familiar with R and use it every now and then for math related tasks. I have a simple non polynomial function that i would like to approximate with a polynomial. I already looked into poly, but was unable to understand what to do with it. So my problem is this. I can generate virtually any number of datapoints and would like to find the coeffs a1, a2, ... up to a given
2003 Jan 16
2
polynomial contrasts in R
In S-Plus, I can obtain polynomial contrasts for an ordered factor with contr.poly(). The function also exists in R, however is limited to factors where the levels are equally spaced. In S-Plus, one can obtain the contrasts for a set of numeric values representing unequally spaced ordered factors. Has anyone implemented this in R? I see that the S-Plus function calls another function (poly.raw())
2011 Feb 02
2
unequally spaced factor levels orthogonal polynomial contrasts coefficients trend analysis
Hello [R]-help I am trying to find > a package where you can do ANOVA based trend analysis on grouped data > using orthogonal polynomial contrasts coefficients, for unequally > spaced factor levels. The closest hit I've had is from this web site: >(http://webcache.googleusercontent.com/search?q=cache:xN4K_KGuYGcJ:www.datavis.ca/sasmac/orpoly.html+Orthogonal+polynomial >l but I
2013 Apr 27
2
Polynomial Regression and NA coefficients in R
Hey all, I'm performing polynomial regression. I'm simulating x values using runif() and y values using a deterministic function of x and rnorm(). When I perform polynomial regression like this: fit_poly <- lm(y ~ poly(x,11,raw = TRUE)) I get some NA coefficients. I think this is due to the high correlation between say x and x^2 if x is distributed uniformly on the unit interval
2006 Nov 13
1
wishlist: xlim in lines.polynomial (PR#9362)
Full_Name: Tamas K Papp Version: 2.4.0 OS: linux Submission from: (NULL) (140.180.166.160) I was using the lines.polynomial method for plotting piecewise polynomials (parts of splines). I needed a feature to limit the range of plotting using a parameter given to the function (as opposed to par("usr")). I think that the following changes would be a nice addition: lines.polynomial
2008 Aug 19
1
Polynomial regression help
I have a simple X, Y data frame that I am trying to run regression analysis on. The linear regression looks great, but when I use lm(formula = y ~ poly(x, degree = 5)) I get the same coeffecients. So for example if I use degree =3 my formula would look like y = 4.2 x^3 + 3.2x^2 + 2.1x + 1.0 and my degree 5 would look like y = 6.5x^5+ 5.4x^4 + 4.2 x^3 + 3.2x^2 + 2.1x + 1.0, which doesn't make
2010 Oct 05
2
Using as.polynomial() over a matrix
Hello All First - a warning. I'm not very R or programming savvy. I am trying to do something without much luck, and have scoured help-pages, but nothing has come up. Here it is: I have a matrix (m) of approx 40,000 rows and 3 columns, filled with numbers. I would like to convert the contents of this matrix into another matrix (m_p), where the numbers of (m) have been coerced into a
2005 Jun 14
2
ordinary polynomial coefficients from orthogonal polynomials?
How can ordinary polynomial coefficients be calculated from an orthogonal polynomial fit? I'm trying to do something like find a,b,c,d from lm(billions ~ a+b*decade+c*decade^2+d*decade^3) but that gives: "Error in eval(expr, envir, enclos) : Object "a" not found" > decade <- c(1950, 1960, 1970, 1980, 1990) > billions <- c(3.5, 5, 7.5, 13, 40) > #
2006 May 27
1
Recommended package nlme: bug in predict.lme when an independent variable is a polynomial (PR#8905)
Full_Name: Renaud Lancelot Version: Version 2.3.0 (2006-04-24) OS: MS Windows XP Pro SP2 Submission from: (NULL) (82.239.219.108) I think there is a bug in predict.lme, when a polynomial generated by poly() is used as an explanatory variable, and a new data.frame is used for predictions. I guess this is related to * not * using, for predictions, the coefs used in constructing the orthogonal