search for: mycoefs

Displaying 11 results from an estimated 11 matches for "mycoefs".

Did you mean: mycoef
2006 May 19
1
UseMethod infelicity
If I do > example(lm) ... > mycoef <- function(object, ...) UseMethod("coef", object) > mycoef(lm.D9) Error in mycoef(lm.D9) : no applicable method for "coef" which is pretty surprising, as coef has a default method. After a bit of digging, this comes from do_usemethod having defenv = environment where the generic was defined */ defenv =
2009 Jun 29
2
How to use "subset" in lm function
Hi, I'm using R to do a time series analysis. In the model, I use the lags of some variables. such the lags of the variables have different length, I just can't use them directly in the lm function. Intuitively, I feel that "subset" might be useful, but I do not know how to use it. Anyone can give me an example syntax? Thanks. Harry [[alternative HTML version deleted]]
2012 May 05
2
No error message no display output
Hi all, I´m re-starting (as my name indicates) my little knowlegde of CRAN R. I made this function time before but I don´t know where is the error because nothing appears as an error but the histogram plot doesn´t appear. Should I install some special library to run sapply? pru<-function(){ randz<-matrix(rnorm(200000),100,2000) H<-matrix(0,100,2000) for (j in 2:2000){ for (i in
2007 Aug 20
1
Q: combine 2 data frames with missing values
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070820/920567a6/attachment.pl
2009 Jul 15
0
strategy to iterate over repeated measures/longitudinal data
...2 = sample(c("a","b"),10,replace=TRUE), predictor3 = sample(c("a","b"),10,replace=TRUE), measurement1=rnorm(10), measurement2=rnorm(10)) #vector of names to iterate over predictor_names <- colnames(wide_data)[2:4] #vector to store coefficients mycoefs <- rep(-1,length(predictor_names)) names(mycoefs) <- predictor_names for (predictor in predictor_names) { long_data <- make.univ( data.frame(wide_data$id,wide_data[,predictor]), data.frame( wide_data$measurement1, wide_data$measurement2 ) ) names(long_dat...
2005 Apr 08
1
subset arg lmList
...bjects they need. This trivial example produces "Error in rownames(fakedf) : Object "fakedf" not found": library(nlme) fitbyID <- function() { fakedf <- data.frame(ID = gl(5, 10, 50), A = sample(1:100, 50), B = rnorm(50)) mycoefs <- lmList(B ~ A | ID, data = fakedf, subset = !is.element(rownames(fakedf), c("3", "10"))) coef(mycoefs) } fitbyID() If fakedf is already in the workspace, then the function runs fine, so ro...
2012 May 10
1
Error t value matrix
Hi all, I want to make the following: I want to run a linear regression on each column of a matrix "estima" on the correspondent column on the matrix "estima2". You see I want to regress estima[,1] on estima2[,1] this way to all columns.... At the same time I want to make a regression adding each time a new observation. You see, the first regression will regress only one
2002 Oct 09
5
polynomial
Any better (more efficient, built-in) ideas for computing coef[1]+coef[2]*x+coef[3]*x^2+ ... than polynom <- function(coef,x) { n <- length(coef) sum(coef*apply(matrix(c(rep(x,n),seq(0,n-1)),ncol=2),1,function(z)z[1]^z[2])) } ? Ben -- 318 Carr Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker
2016 Apr 30
0
Unexpected scores from weighted PCA with svyprcomp()
Hello! I'd like to create an assets-based economic indicator using data from a national household survey. The economic indicator is to be the first principal component from a principal components analysis, which (given the source of the data) I believe should take in consideration the sampling weights of the observations. After running the PCA with svyprcomp(), from the survey package, I
2011 Jul 07
3
coefficients lm of data.frame
Hi, I've a data frame like this: > as.data.frame(cbind(rnorm(1:12),rnorm(1:12))) V1 V2 1 -1.30849402 -0.52094136 2 0.96157302 0.76217871 3 -0.44223351 -1.72630871 4 -0.10432438 -1.04732942 5 -1.38748914 0.95877311 6 -0.63965975 0.65494811 7 -0.24058318 0.19496830 8 -0.11172988 1.01680655 9 0.08065333 0.22168589 10 0.25196536 0.84619914 11
2009 Jun 25
1
lm
Hi all, I want to make multiple least squares estimation on two matrix (without intercept) imagine matrix "a" and matrix "b", I want to "regress" each colum on matrix "a" (dependent variable) on each column of matrix b, I mean, regress first colum on a to first column on b. Second column on a to second column on b. Imagine "a" and "b"