similar to: apply lm() for all the columns of a matrix

Displaying 20 results from an estimated 6000 matches similar to: "apply lm() for all the columns of a matrix"

2008 Mar 17
1
how to plot a map on a non-rectilinear grid
Hi everyone I have a matrix (let's say that it contains the values of elevation) and want to plot its values on a map using a function such as image.plot or filled.contour. The problem is that my grid is not rectilinear, it is bended. Here is an example lon<-matrix(0,20,25) lat<-matrix(0,20,25) elev<-matrix(0,20,25) for (i in 1:20) { for (j in 1:25) {
2004 Sep 14
3
memory allocation error message
Dear all I use the library(netCDF) to read in NCEP data. The file I want to read has size 113 Mb. When i try to read it I get the following message: Error: cannot allocate vector of size 221080 Kb In addition: Warning message: Reached total allocation of 255Mb: see help(memory.size) I get a similar message when I try to read a file with 256 Mb in a PC with 2 GigaByte RAM. Is there something
2003 Aug 01
1
gls function
Dear all I use the gls function but in contrast to the lm function in which when I type summary(lm(...))$coef I receive all the coefficients (estimate, Std. Error, t-value and pvalue), with gls when I type summary(gls(...))$coef I only receive the estimate of the reg. coefficient without std. error and t- and p-values. Dou you have any suggestion how to solve my problem? With kind regards
2008 Jan 07
2
output into an unformatted direct fortran file
Hello everybody Is there a way to output data into a file like the unformatted, direct fortran files? That's the kind that can be opened with: open(30, file='file', format='unformatted', access='direct', rec=1000, convert='big endian') Thank you in advance Kostas Douvis
2005 Apr 15
1
AR1 in gls function
Dear R-project users I would like to calculate a linear trend versus time taking into account a first order autoregressive process of a single time series (e.g. data$S80 in the following example) using th gls function. gls(S80 ~ tt,data=data,corAR1(value, form, fixed)) My question is what number to set in the position of value within corAR1? Should it be the acf at lag 1? I look forward for
2006 Jun 26
1
About filled.contour function
Dear R-projects users I would like like to ask if there is any way to produce a multipanel plot with the filled.contour function. In the help information of filled contour it is said that this function is restricted to a full page display. With kind regards Prodromos Zanis -- **************************************************** Dr. Prodromos Zanis Centre for Atmospheric Physics and
2006 Mar 01
3
matrix matching NA
Dear R list members, I am seeking for an elegant way for matching NA elements of a matrix. Everthing I tried, the result was a vector. Here ist an example with vectors that works: a and b are vectors of same lenght representing pairs of data (a[i] b[i]) with some NA elements: ## R Code a <- (1:5) a[2] <- NA b <- (6:10) b[3] <- NA a 1 NA 3 4 5 b 6 7 NA 9 10 ## /R
2004 Jul 20
9
Sort a data frame
Hi all I have the next data frame year STOD SLAGNR TAL TALT TALVEKT 1 2002 2120006 57 1 NA 1 2 1997 97030032 57 NA NA NA 3 1997 97030071 27 1 NA NA 4 1997 97030005 57 1 NA NA 5 1997 97020127 60 NA 1 NA 6 2001 1160025 27 1 NA 1 7 1998 98020069 60 1 NA NA 8
2005 Mar 10
3
two-dimensional integration?
I find the one-dimensional "integrate" very helpful, but often enough I stumble into problems that require two (or more)-dimensional integrals. I suppose there are no R functions that can do this for me, "directly"? The ideal thing would be to be able to define say f <- function(x) { x1 <- x[1] x2 <- x[2] sin(x1*x2)*exp(x1-x2) } and then write say integrate(f,
2006 Jan 04
4
Discrepency between confidence intervals from t.test and computed manually -- why?
I am sure there is something simple here I am missing, so please bear with me. It concerns the computation of the confidence interval for a population mean. The data are 125 measurements of Cs137 radation, a sample data set from Davis "Statistics and Data Analysis in Geology" 3rd ed. (CROATRAD.TXT) ------------------ method 1: using textbook definitions: mean \pm se_mean * t-value mu
2023 Jan 31
3
How to calculate the derivatives at each data point?
Hi everyone, I have a vector with atmospheric measurements (x-axis) that is obtained/calculated at different altitudes (y-axis). The altitude is uniformly distributed every 7 meters. For example my dataframe is: df <- dataframe( *altitude* = c(1005, 1012, 1019, 1026, 1033, 1040, 1047, 1054, 1061, 1068), *atm_values* = c(1.41, 1.40, 1.39, 1.38, 1.37, 1.37, 1.38, 1.36, 1.33, 1.31)
2005 Feb 16
4
Passing colnames to graphics title
Hi, Just a quick query - if I'm creating a function to produce a number of histograms per page of output (one per column from a matrix), how can I pass the column name of the matrix into the title (or indeed to form part of the x-axis label)? TIA, Laura Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax:
2023 Jan 31
1
[EXT] How to calculate the derivatives at each data point?
Try something like with(df, predict(smooth.spline(x = altitude, y = atm_values), deriv = 1)) Cheers, Andrew -- Andrew Robinson Chief Executive Officer, CEBRA and Professor of Biosecurity, School/s of BioSciences and Mathematics & Statistics University of Melbourne, VIC 3010 Australia Tel: (+61) 0403 138 955 Email: apro at unimelb.edu.au Website: https://researchers.ms.unimelb.edu.au/~apro
2010 Jun 30
1
vlmc - "In vlmc(traffic.clusters.stationary, cutoff = i) : alphabet with >1-letter strings; trying to abbreviate"
Dear all (copying the package author), I have a question on the vlmc package. I am trying to model a time series, where each element can take one of 11 values (the result of some clustering). When I run the following command (synthetic data to facilitate self-contained example) I get the following warning: ("alphabet with >1-letter strings; trying to abbreviate") +++ START+++ >
2006 May 12
3
Maximum likelihood estimate of bivariate vonmises-weibulldistribution
Thanks Dimitris!!! That's much clearer now. Still have a lot of work to do this weekend to understand every bit but your code will prove very useful. Cheers, Aziz -----Original Message----- From: Dimitrios Rizopoulos [mailto:Dimitris.Rizopoulos at med.kuleuven.be] Sent: May 12, 2006 4:35 PM To: Chaouch, Aziz Subject: RE: [R] Maximum likelihood estimate of bivariate
2023 Jan 31
1
How to calculate the derivatives at each data point?
Hi Konstantinos Not exactly derivative but > diff(df[,2]) [1] -0.01 -0.01 -0.01 -0.01 0.00 0.01 -0.02 -0.03 -0.02 May be enaough for you. Cheers Petr > > -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of konstantinos > christodoulou > Sent: Tuesday, January 31, 2023 10:16 AM > To: r-help mailing list <r-help at
2005 Sep 25
2
getting variable length numerical gradient
Hi all. I have a numerical function f(x), with x being a vector of generic size (say k=4), and I wanna take the numerically computed gradient, using deriv or numericDeriv (or something else). My difficulties here are that in deriv and numericDeric the function is passed as an expression, and one have to pass the list of variables involved as a char vector... So, it's a pure R programming
2006 Mar 02
2
'...' passed to both plot() and legend()
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx, dnorm(dx), type = "l", ...) if (legend)
2006 Nov 09
4
Plotting symbols with two positions?
Thanks a lot to Demitris for a prompt answer some minutes ago on another tread (see below). To avoid excess mails on the list, I move onto next question: I have another small plotting problem that confuses me. I want to plot results from a field trial series, using the numbers of the trials as symbols in the plot. pch = as.character(trial_no) works fine, but truncates the trial number to the
2006 Jan 02
2
mixed effects models - negative binomial family?
Hello all, I would like to fit a mixed effects model, but my response is of the negative binomial (or overdispersed poisson) family. The only (?) package that looks like it can do this is glmm.ADMB (but it cannot run on Mac OS X - please correct me if I am wrong!) [1] I think that glmmML {glmmML}, lmer {Matrix}, and glmmPQL {MASS} do not provide this "family" (i.e. nbinom, or