similar to: Plotting a smooth curve from predict

Displaying 20 results from an estimated 20000 matches similar to: "Plotting a smooth curve from predict"

2012 Apr 19
2
Gls function in rms package
Dear R-help, I don't understand why Gls gives me an error when trying to fit a model with AR(2) errors, while gls (from nlme) does not. For example: library(nlme) library(rms) set.seed(1) d <- data.frame(x = rnorm(50), y = rnorm(50)) gls(y ~ x, data=d, correlation = corARMA(p=2)) #This works Gls(y ~ x, data=d, correlation = corARMA(p=2)) # Gives error # Error in
2006 Mar 13
1
P-values in gls
When fitting a simple linear or polynomial regression using lm, R provides a p-value for the whole model as well as for the individual coefficients. When fitting the same models using gls (in order to correct for autocorrelation), there doesn't seem to be a p-value provided for the whole model, although LL, AIC and BIC statistics are provided. Is it possible to obtain a p-value for the whole
2007 Apr 16
2
Plotting data with a fitted curve
Suppose you have a vector of data in x and response values in y. How do you plot together both the points (x,y) and the curve that results from the fitted model, if the model is not y ~ x, but a higher order polynomial, e.g. y~poly(x,2)? (In other words, abline doesn't work for this case.) Thanks, --Paul -- Paul Lynch Aquilent, Inc. National Library of Medicine (Contractor)
2017 Jun 26
3
Jagged ROC curves?
Hi, I was trying to draw some ROC curves (prediction of case/control status), but seem to be getting a somewhat jagged plot. Can I do something that would 'smooth' it somewhat? Most roc curves seem to have many incremental changes (in x and y directions), but my plot only has 4 or 5 steps even though there are 22 data points. Should I be doing something differently? How can I provide a
2005 Dec 09
1
R-help: gls with correlation=corARMA
Dear Madams/Sirs, Hello. I am using the gls function to specify an arma correlation during estimation in my model. The parameter values which I am sending the corARMA function are from a previous fit using arima. I have had some success with the method, however in other cases I get the following error from gls: "All parameters must be less than 1 in absolute value". None of
2012 May 02
3
Consulta gráfica
  Hola,   Por favor, ¿podríais indicarme qué recursos (librerías o ideas) pueden resultar de utilidad para crear un gráfico del estilo del de la figura 3.8 del siguiente link?   http://www.tsc.uvigo.es/BIO/Bioing/ChrLDoc3.html#3.5   Actualmente estoy utilizando funciones muy básicas y la verdad es que no me encuentro muy satisfecha con el resultado.   Muchas gracias.   Eva [[alternative HTML
2010 Aug 23
1
Fitting a regression model with with ARMA error
Hi, I want to fit a regression model with one independent variable. The error part should be fitted an ARMA process. For example, y_t = a + b*x_t + e_t where e_t is modelled as an ARMA process. Please let me know how do I do this in R. What code should I use? TIA Aditya [[alternative HTML version deleted]]
2004 Mar 09
2
corARMA and ACF in nlme
Hi R-sters, Just wondering what I might be doing wrong. I'm trying to fit a multiple linear regression model, and being ever mindful about the possibilities of autocorrelation in the errors (it's a time series), the errors appear to follow an AR1 process (ar(ts(glsfit$residuals)) selected order 1). So, when I go back and try to do the simultaneous regression and error fit with gls,
2012 Mar 19
1
fitting a histogram to a Gaussian curve
Hello, I am trying to fit my histogram to a smooth Gaussian curve(the data closely resembles one except a few bars). This is my code : #!/usr/bin/Rscript out_file = "irc_20M_opencl_test.png" png(out_file) scan("my.csv") -> myvals hist(myvals, breaks = 50, main = "My Distribution",xlab = "My Values") pdens <- density(myvals, na.rm=T) plot(pdens,
2017 Jun 26
0
Jagged ROC curves?
> On Jun 26, 2017, at 11:40 AM, Brian Smith <bsmith030465 at gmail.com> wrote: > > Hi, > > I was trying to draw some ROC curves (prediction of case/control status), > but seem to be getting a somewhat jagged plot. Can I do something that > would 'smooth' it somewhat? Most roc curves seem to have many incremental > changes (in x and y directions), but my plot
2006 Dec 06
1
Questions about regression with time-series
Hi, I am using 2 times series and I want to carry out a regression of Seri1 by Serie2 using structured (autocorrelated) errors. (Equivalent to the autoreg function in SAS) I found the function gls (package nlme) and I made: gls_mens<-gls(mening_s_des~dataATB, correlation = corAR1()) My problem is that I don’t want a AR(1) structure but ARMA(n,p) but the execution fails :
2009 Jan 28
1
gls prediction using the correlation structure in nlme
How does one coerce predict.gls to incorporate the fitted correlation structure from the gls object into predictions? In the example below the AR(1) process with phi=0.545 is not used with predict.gls. Is there another function that does this? I'm going to want to fit a few dozen models varying in order from AR(1) to AR(3) and would like to look at the fits with the correlation structure
2008 May 02
1
Errors using nlme's gls with autocorrelation
Hi, I am trying out a generalized least squares method of forecasting that corrects for autocorrelation. I downloaded daily stock data from Yahoo Finance, and am trying to predict Close (n=7903). I have learned to use date functions to extract indicator variables for Monday - Friday (and Friday is missing in the model to prevent it from becoming full rank). When I run the following code...
2009 Oct 27
3
how do I plot a regression curve with the data?
I have a data set of 6 or so ordered pairs, and I've been able to graph them and have decided to use a high-order polynomial regression. I've used the following piece of code: regression <- function(x,y) { x <- c(insert_numbers_here) y <- c(insert_other_numbers_here) fit <- lm(y ~ x + I(x^2) + I(x^3) + I(x^4) + I(x^5) + I(x^6) + I(x^7) + I(x^8) + I(x^9))
2005 Aug 29
1
Different sings for correlations in OLS and TSA
Dear list, I am trying to re-analyse something. I do have two time series, one of which (ts.mar) might help explaining the other (ts.anr). In the original analysis, no-one seems to have cared about the data being time-series and they just did OLS. This yielded a strong positive correlation. I want to know if this correlation is still as strong when the autocorrelations are taken into account.
2006 Nov 06
1
question about function "gls" in library "nlme"
Hi: The gls function I used in my code is the following fm<-gls(y~x,correlation=corARMA(p=2) ) My question is how to extact the AR(2) parameters from "fm". The object "fm" is the following. How can I extract the correlation parameters Phi1 and Phi2 from "fm"? These two parametrs is not in the "coef" componenet of "fm". Thanks a
2006 Aug 09
1
Joint confidence intervals for GLS models?
Dear All, I would like to be able to estimate confidence intervals for a linear combination of coefficients for a GLS model. I am familiar with John Foxton's helpful paper on Time Series Regression and Generalised Least Squares (GLS) and have learnt a bit about the gls function. I have downloaded the gmodels package so I can use the estimable function. The estimable function is very
2008 Jul 17
1
smooth.spline
I like what smooth.spline does but I am unclear on the output. I can see from the documentation that there are fit.coef but I am unclear what those coeficients are applied to.With spline I understand the "noraml" coefficients applied to a cubic polynomial. But these coefficients I am not sure how to interpret. If I had a description of the algorithm maybe I could figure it out but as it
2010 Nov 01
6
connecting points into a smooth curve
If I have, say, five scatter points and want to connect them together into a smooth curve. I did plot(x,y,type="l"), but the graph is five segments connecting with each other, but not a smooth curve. I wonder if there is a line type that is a curve. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/connecting-points-into-a-smooth-curve-tp3021796p3021796.html Sent
2004 Jun 21
1
Novice question: Smooth interpolation of survival curve
Greetings, How might one go about generating a smooth interpolation of a survival curve generated by the survfit function in the survival package? I am able to package my variables by standard methods >x<-(survfit(Surv(time),data) and plot the "step" curve, but would like to obtain a smooth estimation curve for the purpose of approximating survival time between steps on the