similar to: understanding predict.lm

Displaying 20 results from an estimated 4000 matches similar to: "understanding predict.lm"

2005 Apr 19
3
Help with predict.lm
Hi I have measured the UV absorbance (abs) of 10 solutions of a substance at known concentrations (conc) and have used a linear model to plot a calibration graph with confidence limits. I now want to predict the concentration of solutions with UV absorbance results given in the new.abs data.frame, however predict.lm only appears to work for new "conc" variables not new "abs"
2004 Sep 17
0
Ploting Mean and SE on regression lines
Dear all, I wanted to plot the mean and standard error on the regression equation (instead of individual data points) in the following code, but I could not find the right code in the help files. Could someone please show how to do this. Thank you very much. temp <- c(16,16,16,16,16, 20,20,20,20,20, 24,24,24,24,24, 28,28,28,28,28, 32,32,32,32,32) dev1hr <- c(36.2, 34, 32.2, 36.4, 36,
2006 Oct 29
1
Unexpected behavior of predict and interval="confidence"
Based on some recent r-help discussions, I have been trying out plotting confidence intervals using predict and matplot. Matplot appeared to not be plotting the linear regression when using the default column names generated by read.table (V1, V2, etc). On further inspection, the error seemed to be with predict and vector names (V1, V2) rather than with matplot. I was using some textbook
2009 Jul 14
5
plotting confidence intervals
Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but that doesn't seem to do what I want. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and
2001 Apr 09
5
predict problem
Windows 98 R : Copyright 2001, The R Development Core Team Version 1.2.1 (2001-01-15) Dear friends. How comes this works and produce a single prediction: x <- rnorm(15) y <- x + rnorm(15) predict(lm(y ~ x)) new <- data.frame(x = seq(-3, 3, 0.5)) predict(lm(y ~ x), new, se.fit = TRUE) pred.w.plim <- predict(lm(y ~ x), new, interval="confidence") new1 <- data.frame(x=3)
2023 Nov 06
0
understanding predict.lm
Doh! Thanks very much. sg On 11/6/23 5:17 PM, John Fox wrote: > Dear Spencer, > > You need the t distribution with correct df, not the standard-normal > distribution: > > > pt(-z.confInt/2, df=13) > ??? 1???? 2???? 3???? 4???? 5???? 6???? 7???? 8???? 9??? 10??? 11 > 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 0.025 > ?? 12??? 13 > 0.025
2017 Jul 23
1
BayesianTools update prior
Hi, Using the example in ?VSEM in the package BayesianTools I'm attempting to iteratively update the prior but find the plotTimeSeriesResults produces the following errors when I extend the VSEM example in BayesianTools. With the Code below (the errors) I get: " Error in quantile.default(x, probs = quantiles[i]) : missing values and NaN's not allowed if 'na.rm' is
2009 Jul 23
1
Creating a loop to read 3D dataset
Dear all, I have in my possession a netcdf from which I want to extract some data files. I have used the "ncdf" package to read the netcdf file and used the "get.var.ncdf" function to identify the variable i wish to use. The data is in the form of a time-series of geographical data points that relate to climatology variables. As such I have a large data frame,
2012 Dec 13
2
More efficient use of reshape?
Hi all, I have played a bit with the "reshape" package and function along with "melt" and "cast", but I feel I still don't have a good handle on how to use them efficiently. Below I have included a application of "reshape" that is rather clunky and I'm hoping someone can offer advice on how to use reshape (or melt/cast) more efficiently. #For this
2013 Feb 18
1
Calculating seasonal anomalies
I have an irregular time series, which cannot easily be converted to a ts object (long stretches with NA). I have calculated the climatological mean and st.dev, but need help on how to calculate the anomalies from the climatology and my original data set. Below is an example, where I have indicated the basic idea of what I want to do under Question 1 and 2. I assume I will have to create a custom
2016 Apr 22
2
Unexpected values obtained when reading in data using ncdf and ncdf4
Dear R Users, I am encountering a problem when reading nc files into R using the ncdf and ncdf4 libraries. The nc files are too large to attach an example (but if someone is interested in helping out I could send a file privately via an online drive), but the code is basic: for(i in 1:length(thesenames[,1])){ data <- nc_open(paste(INDIR, thesenames[i,c("wholename")],
2006 Jun 27
3
Possible to get a definition of a function from a package to use without invoking the package?
Hi, I often use the mod() and instring() functions that are available in the clim.pact package. This package has a lot of dependencies, including installation of netCDF, and I haven't yet been able to get library(clim.pact) to work on a Mac OS 10.4.6. A previous request for help with the Mac problem yielded no results, so now I wonder if I could just extract the definitions for the couple
2016 Apr 22
0
Unexpected values obtained when reading in data using ncdf and ncdf4
On Fri, Apr 22, 2016 at 1:32 AM, Louise Mair <louise.mair at slu.se> wrote: > Dear R Users, > > I am encountering a problem when reading nc files into R using the ncdf > and ncdf4 libraries. The nc files are too large to attach an example (but > if someone is interested in helping out I could send a file privately via > an online drive), but the code is basic: > ?[...]?
2018 May 24
2
Problem with adding a raster and a brick
Hi, I seem to be having a problem adding the following two raster objects together - one is a rasterLayer, the other is a rasterBrick. The extent, resolution, and origin are the same, so according to my understand it should work. The objects look like so: > obs.clim class : RasterLayer dimensions : 60, 200, 12000 (nrow, ncol, ncell) resolution : 0.5, 0.5 (x, y) extent : -70,
2010 Oct 29
2
doubt in climate variability analysis in R!
Hello all, I am trying to use "clim.pact" package for my work, but since this is the beginning for me to use gridded datasets in "R", I am having some trouble. I want to do seasonal analyses like trends, anomalies, variograms, EOF and probably kriging too to downscale my 1 degree gridded data to 0.5.  So, as a first step, I compiled my entire dataset (with 25
2011 Nov 29
1
Problems with Raster and clim.pact packages with large netcdf files (2.7G) in x64 bit R
I normally use the raster or clim.pact pckages to read netcdf (.nc) files. This has always worked out for me until this weekend every time i try to read a .nc file i get the following error Program: C:\Program Files\RStudio\bin\x64\rsession.exe File: posixio.c, Line 417 Expression: offset >= 0 This application has requested the Runtime to terminate it in an unusual way.Please contact the
2005 Nov 07
1
Help with downloading clim.pact
I am wondering if anyone might know why the package clim.pact won't install properly. I have tried many URL sites and the same thing happens. I get the error message below. I also tried downloading the ZIP from the CRAN site and extracting the file myself, but an error message (something like, "not an archive file") appears. I operate through Windows. Thanks. Gary Nelson.
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
2011 Feb 16
1
Timeseries Data Plotted as Monthly Boxplots
Hello, I'm trying to develop a box plot of time series data to look at the range in the data values over the entire period of record. My data initially starts out as a list of hourly data, and then I've been using this code to make this data into the final ts array. # Read in the station list stn.list <- read.csv("/home/kbennett/fews/stnlist3", as.is=T, header=F) # Read in
2004 Dec 21
4
Removing trailing spaces
Some years ago when I used S-PLUS, I seem to remember, there was a discussion about a simple method of removing trailing spaces from vector elements. I'd be fairly sure the same would work in R, but I can't find any mention of anything like it in the R archives or with help.search(). There are ways I could do it with substring(), but I seem to remember there was something more elegant.