similar to: how does R compute Std. Error's?

Displaying 20 results from an estimated 1000 matches similar to: "how does R compute Std. Error's?"

2009 Oct 28
5
re gression with multiple dependent variables?
i have a series of regressions i need to run where everything is the same except for the dependent variable, e.g.: lm(y1 ~ x1+x2+x3+x4+x5, data=data) lm(y2 ~ x1+x2+x3+x4+x5, data=data) lm(y3 ~ x1+x2+x3+x4+x5, data=data) is it possible to run all these regs with a single command? given that the bulk of the work for linear regressions is inverting a matrix that depends only on the independent
2008 Oct 22
3
coalesce columns within a data frame
Dear all, I searched the mail archives and the R site and found no guidance (tried "merge", "cbind" and terms like "coalesce" with no success). There surely is a way to coalesce (like in SQL) columns in a dataframe, right? For example, I would like to go from a dataframe with two columns to one with only one as follows: From Name.x Name.y nx1 ny1 nx2 NA
2005 May 01
1
opimization problem
hi, i want to execute the following opimization problem: max r*w s.t.: w*z=1 # sum of w is 1 r, w are [nx1] vectors, z is a [nx1] vector consisting of 1 so far so good, works fine with lp the problem arises with the additional restriction w' * V * w where V is a [nxn] matrix how can i include this restriction since w arises twice? thanks, gg --
2003 Aug 04
1
Novice question
Hello. I am new R user, so this question is probably quite stupid, but for the life of me I cannot figure out how to get predications using multivariate linear regression analysis. Single variable predictions work fine. I am trying the following: -- Known y's for known x's1 and x's2 ys <- c(133890, 135000, 135790, 137300, 138130, 139100, 139900, 141120, 141890, 143230, 144000,
2009 Oct 06
1
linear model with coefficient constraints
I would like to perform a regression like the one below: lm(x ~ 0 + a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3, data=data) However, the data has the property that a1+a2+a3 = A, b1+b2+b3 = B, and c1+c2+c3 = C, where A, B, and C are positive constants. So there are two extra degrees of freedom, and R handles this by producing NA for two of the coefficients. Instead, I would prefer to remove the
2009 Nov 30
1
updating subset of data.frame
i have a data frame and a numeric vector indexed as a subset of the rows in the data.frame. what command can i use to assign the values in the vector to the appropriate rows of the data.frame? here's my failed attempt. what i would want is data[1,'z'] == 2, data[5,'z'] == -4, data[8,'z'] == -5, data[9,'z'] == 5, and for the other values of 'z' to
2012 Mar 08
3
Calculating length of consecutive sequences within a vector
Hi all, I have a nx1 logical array of zeros and ones and I want to calculate the individual lengths of all 1-consecutive sequences contained in it. Is there an easy quick way to do this in R? So, if I have a vector such as 111001101000011111110 I would like to get (1) 3, (2) 2, (3) 1, (4) 7 Any help would be appreciated! thanks! Jorge [[alternative HTML version deleted]]
2009 Oct 03
3
getting variables based on name
I have a file like this: a1,a2,a3,b1,b2,b3 1,2,3,4,5,6 0,1,2,3,4,5 ... In interactive command-line R, I type data<-read.table('file.txt', sep=',', header=TRUE) I then want to get all the columns which start with the letter a. For this particular file, I can the type: data[1:3] What if i don't know that the columns that start with 'a' are columns 1-3? Is there
2010 Aug 10
1
Identifying integers (as opposed to real #s) in matrix
Is there a way to identify (for subsequent replacement) which rows in a matrix are comprised entirely of *integers*? I have a large set of *nx3 *matrices where each row either consists of a set of 3 integers or a set of 3 real numbers. A given matrix might looks something like this: [ ,1] [ ,2] [ ,3] [1, ] 121.0000 -98.0000 276.0000 [2,
1997 Sep 05
2
R-beta: help with R simulation
[[this bounced first, because it has 'help' in the Subject line ... -- Martin Maechler ]] I am a complete novice R programmer. (Though I know C quite well) I am trying to write some R code to do the following simulation. There is a 2-frame "movie" of noise and signal dots. the noise dots have random positions in each frame. The signal dots are placed randomly in frame 1,
2009 Jul 07
3
Error due to non-conformable arrays
Hello, Consider this function for generalized ridge regression: gre <- function (X,y,D){ n <- dim(X)[1] p <- dim(X)[2] intercept <- rep(1, n) X <- cbind(intercept, X) X2D <- crossprod(X,X)+ D Xy <- crossprod(X,y) bth <- qr.solve(X2D, Xy) } # suppose X is an (nxp) design matrix and y is an (nx1) response vector p <- dim(x)[2] D<- diag(rep(1.5,p)) bt
2007 Sep 03
2
The quadprog package
Hi everybody, I'm using Windows XP Prof, R 2.5.1 and a Pentium 4 Processor. Now, I want to solve a quadratic optimization program (Portfolio Selection) with the quadprog package I want to minimize (\omega'%*%\Sigma%*%\omega) Subject to (1) \iota' %*% \omega = 1 (full investment) (2) R'%*%\omega = \mu (predefined expectation value) (3) \omega \ge 0 (no short sales). Where
2024 Feb 28
2
converting MATLAB -> R | element-wise operation
On Tue, 27 Feb 2024 13:51:25 -0800 Jeff Newmiller via R-help <r-help at r-project.org> wrote: > The fundamental data type in Matlab is a matrix... they don't have > vectors, they have Nx1 matrices and 1xM matrices. Also known as column vectors and row vectors. :) > Vectors don't have any concept of "row" vs. "column". They do in (numerical) linear
2010 Nov 17
1
Multiple Line Plots with xyplot
I'm trying to make multiple line plots, each with a different color, using the xyplot command. Specifically, I have an NxK matrix Y and an Nx1 matrix x. I would like the plot to contain a line for each (x, Y[,i]), i=1:K. I know something like xyplot(Y[,1] + Y[,2] + Y[,3] ~ x, type='l') will work, but if Y is large, this notation can get very awkward. Is there a way to do something
2013 Sep 08
1
Looking for driver help
I sent an email out to freebsd-net without a response, soo this is my last attempt at getting any assistance here. I have a QLE3142-CU-CK (rebranded NetXen NX3-20GCU w/ NX3031 chipset) with no driver support in *BSD from anything I saw. I came across solaris's ntxn driver which seems to work appropriately but I have no use for solaris as a host o/s. Naturally I'll attempt at trying to get
2011 Sep 20
2
Multivariate spline regression and predicted values
Hello, I am trying to estimate a multivariate regression of Y on X with regression splines. Y is (nx1), and X is (nxd), with d>1. I assume the data is generated by some unknown regression function f(X), as in Y = f(X) + u, where u is some well-behaved regression error. I want to estimate f(X) via regression splines (tensor product splines). Then, I want to get the predicted values for some new
2003 Sep 05
4
Basic Dummy Variable Creation
Hi There, While looking through the mailing list archive, I did not come across a simple minded example regarding the creation of dummy variables. The Gauss language provides the command "y = dummydn(x,v,p)" for creating dummy variables. Here: x = Nx1 vector of data to be broken up into dummy variables. v = Kx1 vector specifying the K-1 breakpoints p = positive integer in the range
2024 Feb 27
2
converting MATLAB -> R | element-wise operation
Why anything but sweep? The fundamental data type in Matlab is a matrix... they don't have vectors, they have Nx1 matrices and 1xM matrices. Vectors don't have any concept of "row" vs. "column". Straight division is always elementwise with recycling as needed, and matrices are really vectors in row-major order: 1 2 3 4 5 6 is really 1 4 2 5 3 6 and when you do
2019 Jul 22
3
[RFC] A new multidimensional array indexing intrinsic
Am Mo., 22. Juli 2019 um 10:50 Uhr schrieb Doerfert, Johannes <jdoerfert at anl.gov>: > Why introduce a new intrinsic (family)? It seems that would require us > to support GEPs and GEP + "multi-dim" semantics in various places. What is > the benefit over a GEP extension? Adding an intrinsic is easier than adding or extending an existing instruction, as suggested by
2006 Jul 22
1
Why the contrain does not work for selecting a particular range of data?
Dear: Continuing the issue of 'ifelse'! I selecting the data whose 'x2'=1 for maximizing likelihood. I used two way to do this but the results are different. 1.Way one I use the data for x2=1 and run the program. It works for me. Tthe program is described as below: function (parameters,y1,x11) { p<-parameters[1] alpha1<-parameters[2] beta1<-parameters[3]