Displaying 15 results from an estimated 15 matches for "linearmodel".
2009 Dec 03
0
Problem with predict() and factors
...MODEL VERIFICATION FIRST!!!!!
#
# Basic Look at the raw data
hist(modelSource)
plot(density(modelSource,na.rm=TRUE))
plot(sort(modelSource),pch=".")
for(i in names(mcReg)) {
pairs(modelSource ~ .,mcReg[[i]], main=paste("Model - MIPS vs",i))
}
#Build the list to store our results
linearModel <- list()
residuals <- list()
arima_Fit <- list()
arima_AO <- list()
arima_IO <- list()
newcReg <- list()
newfReg <- list()
newmcReg <- list()
newmfReg <- list()
newFit <- list()
newForecast <- list()
# Following won't work until mcReg contains full variety
line...
2007 Jan 16
2
problems with for loop
...ng?
Thanks a lot.
for (i in 92:99){
cat("\n",
"=============================================================\n",
"YEAR =",i,"\n",
"=============================================================\n"
)
canos1 <- subset (canos, canos$YEAR==i)
LinearModel.1 <- lm(MM_P ~ BLOC + TIL, data=canos1)
summary(LinearModel.1)
Anova(LinearModel.1, type="II")
Anova(LinearModel.1, type="III")
}
--
**************************************************
Jorge Lampurlan?s Castel
Departament d'Enginyeria Agroforestal
Escola T?cnica S...
2009 May 11
1
predict function the other way around
Dear List,
Consider the following example
x=c(1,2,3,4,5)
y=c(2,4,6,8,10)
linearmodel=lm(y~x)
To predict a y-value if you know the corresponding x value is very easy
with the command predict.
predict(linearmodel, newdata=(x=1.5))
The other way around, to predict an x-value with a corresponding
y-value, doesn't work unfortunately.
Is there another function that can do that,...
2009 Jul 15
2
storing lm() results and other objects in a list
to clean up some code I would like to make a list of arbitrary length
to store?various objects for use in a loop
sample code:
############ BEGIN SAMPLE ##############
# You can see the need for a loop already
linearModel1=lm(modelSource ~ .,mcReg)
linearModel2=step(linearModel1)
linearModel3=lm(modelSource ~ .-1,mcReg)
linearModel4=step(linearModel3)
#custom
linearModel5=lm(modelSource ~ . -ACF-MonthlyST1-MonthlyST2-MonthlyBLA,mcReg)
LinearModel1.res <- residuals(linearModel1)
LinearModel2.res <- residuals(l...
2009 Jul 21
2
Odd coefficent behavior
Why are my coefficients getting appended with a 1? It borks a match I
do later against the original list that doesn't have the random 1
added to the end.
> linearModel[[1]]
Call:
lm(formula = modelSource ~ +UNITBUILD + UNITDB + ITBUILD + ITDB +
UATBUILD + UATDB + HOGANCODE + RCF + ReleaseST1 + ReleaseST2 +
ReleaseBLA + Small.Bank.Acquisitions + HLY.NewYear + HLY.MLK +
HLY.PRES + HLY.MEMORIAL + HLY.J4 + HLY.LABOR + HLY.COLUMBUS +
HLY.VETS + HLY.THANKS + HLY.XMAS...
2009 Nov 09
1
Getting Sphericity Tests for Within Subject Repeated Measure Anova (using "car" package)
...odel or linear model anova and TukeyHSD, but
have no luck with Repeated-Measures Assuming Sphericity or Separate
Sphericity Tests.
I am trying to follow example from "car" package, but it seems that I am not
getting something right.
> Dataset$Sessn <- as.factor(Dataset$Sessn)
> LinearModel.1 <- lm(Response ~ Sessn*Trtmt, data=Dataset)
> summary(LinearModel.1)
All, good so far, but I have problem understanding "idata=" and "idesign="
functions pertaining to my example. Session is my repeated measure (Sessn 1
and Sessn 2 = two sessions, in reality I have mo...
2009 Nov 09
1
Getting Sphericity Tests for Within Subject Repeated Measure Anova (using "car" package) (Adjusted Dataset)
...odel or linear model anova and TukeyHSD, but
have no luck with Repeated-Measures Assuming Sphericity or Separate
Sphericity Tests.
I am trying to follow example from "car" package, but it seems that I am not
getting something right.
> Dataset$Sessn <- as.factor(Dataset$Sessn)
> LinearModel.1 <- lm(Response ~ Sessn*Trtmt, data=Dataset)
> summary(LinearModel.1)
All, good so far, but I have problem understanding "idata=" and "idesign="
functions pertaining to my example. Session is my repeated measure (Sessn 1
and Sessn 2 = two sessions, in reality I have mo...
2003 Aug 07
0
new version of Rcmdr package
...ES file, reproduced below. As usual, comments, suggestions, and
bug reports are appreciated.
John
-------------------------------------------
Version 0.8-4
o Minor bug fixes and additional input-error checks (many suggested by
Tony Christensen).
o Documentation for Recode, Compute, linearModel, and
generalizedLinearModel dialogs. More extensive documentation for the Commander.
o Changes to list*() utility functions to ensure that all objects of a
given class are found, and not masked by local variables or objects in the
base package.
o Many small changes to ensure that obj...
2016 Apr 04
0
Test for Homoscedesticity in R Without BP Test
...the comparison of the estimated variances of residuals when the model is estimated by OLS under the assumption of homoscedasticity and when the model is estimated by OLS under the assumption of heteroscedastic.
The White test with R
install.packages("bstats")
library(bstats)
white.test(LinearModel)
Hope this helps.
Sacha
________________________________
De : Deepak Singh <sdeepakrhelp at gmail.com>
? : r-help at r-project.org
Envoy? le : Lundi 4 avril 2016 10h40
Objet : [R] Test for Homoscedesticity in R Without BP Test
Respected Sir,
I am doing a project on multiple linear...
2016 Apr 04
1
Test for Homoscedesticity in R Without BP Test
...tilize the
function to carry out the White test as illustrated in:
example("CigarettesB", package = "AER")
(Of course, the AER package needs to be installed first.)
> The White test with R
>
> install.packages("bstats")
> library(bstats)
> white.test(LinearModel)
That package is no longer on CRAN as it took the code from bptest()
without crediting its original authors and released it in a package that
conflicted with the original license. Also, the implementation did not
check for potential problems with dummy variables or interactions
mentioned above...
2016 Apr 04
4
Test for Homoscedesticity in R Without BP Test
Respected Sir,
I am doing a project on multiple linear model fitting and in that project I
have to test Homoscedesticity of errors I have google for the same and
found bptest for the same but in R version 3.2.4 bp test is not available.
So please suggest me a test on homoscedesticity ASAP as we have to submit
our report on 7-04-2016.
P.S. : I have plotted residuals against fitted values and it is
2012 Oct 12
2
party for prediction [REPOST]
...effectively
constant (that is x are not independent for all choices of components
of z). When the resulting fit is fed into predict() the result is NA -
this is not the same behaviour as models returned by say lm which
ignore missing coefficients. I have fixed this by defining my own
statsModel (myLinearModel - imaginative) which also ignores such
coefficients when predicting.
The second problem I have is that I get "Cholesky not positive
definite" errors at some nodes. I guess this is because of numerical
error and degeneracy in the covariance matrix? Any thoughts on how to
avoid having this...
2013 Mar 06
2
lm and Formula tutorial
Dear all,
I was reading last night the lm and the Formula manual page, and 'I have to admit that I had tough time to understand their syntax. Is there a simpler guide for the dummies like me to start with?
I would like to thank you in advance for your help
Regards
Alex
[[alternative HTML version deleted]]
2013 Feb 26
2
Efficient way to perform linear regressions
Hi All,
I have millions of regression lines to fit. So I am looking for the
most efficient approach in R.
Details:
I have a large desing matrix X. The dimension is n by p.
Each time when fitting the model, select rows from this matrix X and
form a new design matrix, called X_current.
There is another binary matrix M, with dim m by n, and each row is a
1*n vector. It helps to determin X_current.
2009 Oct 19
1
Reposting various problems with two-way anova, lme, etc.
Hi,
I posted the message below last week, but no answers, so I'm giving it
another attempt in case somebody who would be able to help might have missed
it and it has now dropped off the end of the list of mails.
I am fairly new to R and still trying to figure out how it all works, and I
have run into a few issues. I apologize in advance if my questions are a bit
basic, I'm also no