similar to: Forcing zero intercept in two predictor case - stat question not R question

Displaying 20 results from an estimated 10000 matches similar to: "Forcing zero intercept in two predictor case - stat question not R question"

2007 Aug 28
1
FW: How to fit an linear model withou intercept
Hi Mark, I don't know wether you recived a sufficient reply or not, so here are my comments to your problem. Supressing the constant term in a regression model will probably lead to a violation of the classical assumptions for this model. From the OLS normal equations (in matrix notation) (1) (X'X)b=X'y and the definition of the OLS residuals (2) e = y-Xb you get - by
2007 Nov 28
2
fit linear regression with multiple predictor and constrained intercept
Hi group, I have this type of data x(predictor), y(response), factor (grouping x into many groups, with 6-20 obs/group) I want to fit a linear regression with one common intercept. 'factor' should only modify the slopes, not the intercept. The intercept is expected to be >0. If I use y~ x + factor, I get a different intercept for each factor level, but one slope only if I use y~ x *
2006 Nov 13
2
Forcing the intercept
Dear R-users: I am doing multiple regressions using the "lm" function and would like to force the intercept to be equal to a specific value (such as 4.3). I was able to find out how to force it through the origin but this does not work for other values. I am also interested in forcing the regression parameters obtained from one regression in another regression with a subset of the
2006 Dec 05
3
stat question - not R question so ignore if not interested
If do a scattrplot of data ( x and y ) and there are two clouds of points. One cloud is in the left bottom corner of the plot and the other cloud is in the upper right. If I fit a regression line to this data ( or equivalently , calculate a correlation ), then obviously, it is going to seem like x and y are related because a line has to be connected between the 2 clouds. But, there must be a
2006 Nov 12
7
I think a simple question
I have index ( of a vector ) values of say tempin<-c(1 31 61 91 121 all the way upto 1411) What I want is a function that takes in a number say, x = 5, and gives me an new vector of tempout<-1 6 31 36 91 96 121 126 .......... 1411 1416 This can't be so hard but I can't get it and I've honestly tried. Obviously, tempin + 5 gives me the missing values but I
2006 Oct 24
6
extract certain values from a ts
Hi, Having several daily wind speed time series I want to extract those consecutive days over and below certain values (i.e. 5 < x <8) Don't know which funtion to use (aggregate, lapply?) and how to do it. Thanks in advance Antonio
2013 Jan 01
3
translate grouped data to their centroid
Given a data set with a group factor, I want to translate the numeric variables to their centroid, by subtracting out the group means (adding back the grand means). The following gives what I want, but there must be an easier way using sweep or apply or some such. iris2 <- iris[,c(1,2,5)] means <- colMeans(iris2[,1:2]) pooled <- lm(cbind(Sepal.Length, Sepal.Width) ~ Species,
2007 Aug 24
4
Turning a logical vector into its indices without losing its length
I have the code below which gives me what I want for temp based on logvec but I was wondering if there was a shorter way ( i.e : a one liner ) without having to initialize temp to zeros. This is purely for learning purposes. Thanks. logvec <- c(TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,TRUE,FALSE) temp<-numeric(length(invec)) temp[invec]<-which(invec) temp [1] 1 0 0 4 0 0 7 0 obviously, the
2007 Oct 11
6
confusion with R syntax
I just noticed something by accident with R syntax that I'm sure is correct but I don't understand it. If I have a simple numeric vector x and I subscript it, it seems that I can then subscript a second time with TRUE or FALSE, sort of like a 2 dimensional array in C. Does someone know if this is documented somewhere Because it's neat but I never knew it existed. To me it seems like a
2007 Oct 12
2
Plotting question
I am constructing plots ( regular not lattice ) and my initial command is par(mar=c(3,4,2,2), mfcol=c(5,2)) and then I create 10 plots on the page. It looks great but the plots on the page go in the order 1 6 2 7 3 8 4 9 5 10 Where the numbers denote decile breakdowns. Is there an easy way to make them go from left to right so 1 2 3 4 5 6 7 8 9 10 I could try
2006 Oct 17
3
barplot question
i'm doing a bar plot and there are 16 column variables. is there a way to make the variable names go down instead of across when you do the barplot ? because the names are so long, the barplot just shows 3 names and leaves the rest out. if i could rotate the names 90 degrees, it would probably fit a lot more. or maybe i can use space to make the horizontal width longer ? I looed up ?barlot but
2007 Feb 05
2
ar function in stats
I had a couple of questions about the ar function that i was hoping someone could answer. I have the structure below testSeries<-structure(c(-3.88613620955214e-05, 0, -7.77272551011343e-05, 0, -0.000194344573539562, -0.000116624876218163, -3.88779814601281e-05, 0, 3.88779814601281e-05, -0.000155520995647807, -0.000116656621367561, -3.88885648225368e-05, -3.88900772017586e-05,
2006 Nov 14
2
putting a column name on a zoo object
does anyone know how to put a column name on a zoo object. I think achim and gabor are off line or they have gotten totally tired of me an decided to ignore me ( which is totalyy understandable ). logbidask<-log((aggfxdata[,"bid"] + aggfxdata[,"ask"])/2.0) logbidask doesn't have a name and I can't figure out how to get one on it ? aggfxdata is a zoo object.
2007 Jun 12
3
Panel data
Dear all R users, I have a small doubt about panel data analysis. My basic understanding on Panel data is a type of data that is collected over time and subjects. Vector Autoregressive Model (VAR) model used on this type of data. Therefore can I say that, one of statistical tools used for analysis of panel data is VAR model? If you clarify my doubt I will be very grateful. Thanks and regards,
2010 Jul 07
6
forcing a zero level in contr.sum
I need to use contr.sum and observe that some levels are not statistically different from the overall mean of zero. What is the proper way of forcing the zero estimate? It seems the column corresponding to that level should become a column of zeros. Is there a way to achieve that without me constructing the design matrix? Thank you. Stephen Bond [[alternative HTML version deleted]]
2010 Aug 05
2
linear model with similar response predictor
Hi, can somebody tell me why R is not able to calculate a linear model written in this way? > lm (seq(1:100)~seq(1:100)) Call: lm(formula = seq(1:100) ~ seq(1:100)) Coefficients: (Intercept) 50.5 Warning messages: 1: In model.matrix.default(mt, mf, contrasts) : the response appeared on the right-hand side and was dropped 2: In model.matrix.default(mt, mf, contrasts) : problem
2006 Oct 24
4
How to start R with a file loaded?
Hi! I've made great progress in my R programming, but I am again stuck on a beginner's problem. I would like to start R with a command line that loads a file, and if possible, executes a function. Can anyone give me an example of how to do this? For example, in lisp, I would say: $ lisp -load toto.lisp -eval '(do-something $PORT)' to load the file "toto.lisp", then
2006 Oct 24
4
avoiding a loop
I think I asked a similar question 3 years ago to the Splus list and I think the answer was no or noone answered so noone should spend more than 5 minutes on this because it could definitely be a waste of time. My question is whether the function below can be rewritten without a for loop. apply is fine if it can be done that way but i doubt it. I call it a lot and would prefer to not loop.
2007 Sep 13
5
statistics - hypothesis testing question
I estimate two competing simple regression models, A and B where the LHS is the same in both cases but the predictor is different ( I handle the intercept issue based on other postings I have seen ). I estimate the two models on a weekly basis over 24 weeks. So, I end up with 24 RSquaredAs and 24 RsquaredBs, so essentally 2 time series of Rsquareds. This doesn't have to be necessarily thought
2007 Aug 31
3
Choosing the optimum lag order of ARIMA model
Dear all R users, I am really struggling to determine the most appropriate lag order of ARIMA model. My understanding is that, as for MA [q] model the auto correlation coeff vanishes after q lag, it says the MA order of a ARIMA model, and for a AR[p] model partial autocorrelation vanishes after p lags it helps to determine the AR lag. And most appropriate model choosed by this argument gives