Displaying 20 results from an estimated 49 matches for "lmfit".
2008 Feb 24
3
Newbie: Where is lmFit function?
Hi Everyone,
I am trying to use lmFit function; however, i cannot find it function
anywhere.
I have been trying to find the function in Bioconductor and elsewhere. I
re-install bioconductor source, update package and update R as well. no luck
Is there a command in R where i can just type, and it will download it for
me?
--
View this...
2011 Jan 20
2
Regression Testing
...trated
with excel and found R. Enough of that already.
I'm trying to test and correct for Heteroskedasticity
I have data in a csv file that I load and store in a dataframe.
> ds <- read.csv("book2.csv")
> df <- data.frame(ds)
I then preform a OLS regression:
> lmfit <- lm(df$y~df$x)
To test for Heteroskedasticity, I run the BPtest:
> bptest(lmfit)
studentized Breusch-Pagan test
data: lmfit
BP = 11.6768, df = 1, p-value = 0.0006329
From the above, if I'm interpreting this correctly, there is
Heteroskedasticity present. To correct fo...
2004 Dec 20
2
problems with limma
...t;- cbind(dd$NZW1C,dd$NZW2C,dd$NZW3C,dd$NZW1T,dd$NZW2T,dd$NZW3T)
> akr <- cbind(dd$AKR1C,dd$AKR2C,dd$AKR3C,dd$AKR1T,dd$AKR2T,dd$AKR3T)
> bas <- cbind(dd$NZW1C,dd$NZW2C,dd$NZW3C,dd$AKR1C,dd$AKR2C,dd$AKR3C)
> #
> design<-matrix(c(1,1,1,1,1,1,0,0,0,1,1,1),ncol=2)
> fit1 <- lmFit(nzw,design)
> fit1 <- eBayes(fit1)
> topTable(fit1,adjust="fdr",number=5)
M t P.Value B
12222 3679.480 121.24612 7.828493e-06 -4.508864
1903 3012.405 118.32859 7.828493e-06 -4.508866
9068 1850.232 92.70893 1.178902e-05 -4.508889
10635 2...
2012 Nov 16
1
Interpretation of davies.test() in segmented package
...reakpoints, how is this test able to assess the proper
breakpiont? It appears to only give 1 best breakpoint, which is not
consistent with the breakpoints found by segmented(). Also, is K the number
of breakpoints or the number of iterations that it evaluates the breakpoint?
Thanks in advance.
lmfit<-glm(TotRad_KW~HRRPUA_kWm2,data=d1)
davies.test(lmfit,seg.Z=~HRRPUA_kWm2,k=1000,alternative="less",
beta0=0,dispersion=NULL)
Davies' test for a change in the slope
data: Model = gaussian , link = identity
formula = TotRad_KW ~ HRRPUA_kWm2
segmented variable = HRRPUA_kWm2
`Best&...
2012 Mar 20
2
Constraint Linear regression
...e the following equation -
y <- c(0.2525, 0.3448, 0.2358, 0.3696, 0.2708, 0.1667, 0.2941, 0.2333,
0.1500, 0.3077, 0.3462, 0.1667, 0.2500, 0.3214, 0.1364)
x2 <- c(0.368, 0.537, 0.379, 0.472, 0.401, 0.361, 0.644, 0.444, 0.440,
0.676, 0.679, 0.622, 0.450, 0.379, 0.620)
x1 <- 1-x2
# equation
lmFit <- lm(y ~ x1 + x2)
lmFit
Call:
lm(formula = y ~ x1 + x2)
Coefficients:
(Intercept) x1 x2
0.30521 -0.09726 NA
I would like to *constraint the coefficients of x1 and x2 to be between 0,1*.
Is there a way of adding constraints to lm?
I looked through the ol...
2009 Oct 22
1
S4 object??
...y(limma)
library("Biobase")
data <- read.table("c:/temp/data.txt",header=T,row.names=1)
ExpressionData <- as.matrix(data[,c(2,3,4,6,7,8)])
eset <- new("ExpressionSet", exprs = ExpressionData)
design <- cbind(WT=1,P=c(0,1,1,0,1,1),G=c(0,1,0,0,1,0))
fit <- lmFit(eset,design)
But I keep getting an eroor message after "lmFit" that says:
Error in possibleExtends(cl, class2, class1Def, class2Def) :
trying to get slot "subclasses" from an object (class "classRepresentation") that is not an S4 object
I am using R-2.9.2. Whats...
2008 Feb 11
3
Difference between P.Value and adj.P.Value
Hallo,
> fit12<-lmFit(qrg[,1:2])
> t12<-toptable(fit12,adjust="fdr",number=25,genelist=qrg$genes[,1])
> t12
ID logFC t P.Value adj.P.Val B
522 PLAU_OP -6.836144 -8.420414 5.589416e-05 0.01212520 2.054965
1555 CD44_WIZ -6.569622 -8.227938 6.510169e-05 0.01212520...
2011 Feb 25
1
limma function problem
...ds)
number of samples=3
number of genes=15617
annotation=zebrafish
notes=
> Dicer.fish
AffyBatch object
size of arrays=712x712 features (10 kb)
cdf=Zebrafish (15617 affyids)
number of samples=3
number of genes=15617
annotation=zebrafish
notes=
Now, I have to combine these two S4 objects and use lmFit function of Limma
package.I am able to combine the two S4 objects using merge function.
> merge.fish <-merge(wild.fish,Dicer.fish)
> merge.fish
AffyBatch object
size of arrays=712x712 features (17833 kb)
cdf=Zebrafish (15617 affyids)
number of samples=6
number of genes=15617
annotation=z...
2007 Oct 02
5
Linear Regression
Hello,
I would like to fit a linear regression and when I use summary(), I got the
following result:
Call:
lm(formula = weight ~ group - 1)
Residuals:
Min 1Q Median 3Q Max
-1.0710 -0.4938 0.0685 0.2462 1.3690
Coefficients:
Estimate Std. Error t value Pr(>|t|)
groupCtl 5.0320 0.2202 22.85 9.55e-15 ***
groupTrt 4.6610 0.2202 21.16 3.62e-14
2004 Dec 21
0
Fwd: problems with limma
...d$NZW2C,dd$NZW3C,dd$NZW1T,dd$NZW2T,dd$NZW3T)
>> akr <- cbind(dd$AKR1C,dd$AKR2C,dd$AKR3C,dd$AKR1T,dd$AKR2T,dd$AKR3T)
>> bas <- cbind(dd$NZW1C,dd$NZW2C,dd$NZW3C,dd$AKR1C,dd$AKR2C,dd$AKR3C)
>> #
>> design<-matrix(c(1,1,1,1,1,1,0,0,0,1,1,1),ncol=2)
>> fit1 <- lmFit(nzw,design)
>> fit1 <- eBayes(fit1)
>> topTable(fit1,adjust="fdr",number=5)
> M t P.Value B
> 12222 3679.480 121.24612 7.828493e-06 -4.508864
> 1903 3012.405 118.32859 7.828493e-06 -4.508866
> 9068 1850.232 92.70893 1.1...
2006 Sep 06
2
deleting an arow added to a graphic
I know this has got to be simple, but I have a added an arrow to a graph
with:
arrows(5,8,8, predict(lmfit,data.frame(x=8)), length=0.1)
but its in the wrong position, correcting it and running again adds an new
arrow (which is what you would expect) so how do I
a) edit the existing arrow, and
b) delete it all together
As so often seems to be the case, some of the simplist things seem also to
be the...
2024 Nov 15
1
[EXT] Mac ARM for lm() ?
...Yes, lm.fit() is already faster, and
.lm.fit() {added to base R by me, when a similar question
was asked years ago ...}
is even an order of magnitude faster in some cases.
See ?lm.fit
and notably
example(lm.fit)
which uses pkg microbenchmark for timing and after which
png("lmfit-ex.png")
boxplot(mb, notch=TRUE)
dev.off()
produces the attached nice image.
> Also try the high-performance computing task view on CRAN
> Cheers,
> Andrew
> --
> Andrew Robinson Chief Executive Officer, CEBRA and
> Professor of Biosecurity,...
2014 Oct 07
3
lattice add a fit
...l.loess(...,col.line="red")
}
)
Will add a loess smoother. Instead, I want to put a fit from lm (but not a simple straight line) and the fit has to be done for each panel separately, not one fit for the full data set, so sth like an lm equivalent of panel.locfit (there is no panel.lmfit)
Thank you.
Stephen B
[[alternative HTML version deleted]]
2006 Dec 17
2
question
...in packages doc.
best regards,
Claire Pujoll
Paris, France
library(marray)
library(limma)
.......
Rawdata <- read.GenePix(targets=Macro_Mono_targets,skip=107)
design<- cbind(individual=c(0,0,1,1,2,2,3,3,4,4,5,5),
dim1=c(1,0,1,0,1,0,1,0,1,0,1,0),dim2=c(0,1,0,1,0,1,0,1,0,1,0,1))
fit <- lmFit(normdata@maM, design)
contrast.matrix<-makeContrasts(dim1vsdim2=dim2-dim1, levels=design)
fit2 <- contrasts.fit(fit,contrast.matrix)
fiteb <- eBayes(fit2)
Toptable <- topTable(fiteb,number = 10600,genelist=maGeneTable(normdata),
sort.by="P",
resort.by= "M", adjust=&q...
2007 Nov 13
0
need help with error message:Error in lm.fit(design, t(M)) : incompatible dimensions
Hello,
I am trying to run a code (see reference section) and when I run the line:
fit<-lmFit(xen1dataeset,design),
I get the error message: Error in lm.fit(design, t(M)) : incompatible
dimensions
I will really appreciate if someone can help me understand this error
message and possibly help me debug the problem.
Thanks
manisha
Reference section
xen1data<-ReadAffy()...
2012 Feb 28
1
Volcano Plot
...] is a column of the fold change values and data[12] contains the P
values and I am getting a following error:
Error: geom_point requires the following missing aesthetics: x, y
What can be done for the same ?
And if not what other package may I use for the same in which I don't have
to use a lmfit model?
Thanks
--
View this message in context: http://r.789695.n4.nabble.com/Volcano-Plot-tp4428622p4428622.html
Sent from the R help mailing list archive at Nabble.com.
2012 Mar 05
1
Forward stepwise regression using lmStepAIC in Caret
...wer and upper model, Caret still seems to
default to "backward".
Any thoughts on how I can make this work?
Here is what I tried:
itemonly <- susbstitute(~i1+i2+i3+i4+i5+i6+i7+i8+i9+i10) #this is my full
model
#I want my "lower" model to consist of the intercept only
stepLmFit.i <- train(xtraindata.i, ytraindata,"lmStepAIC",
scope=list(upper=itemonly,lower=~1),direction="forward")
Any guidance on how I can make this work would be greatly appreciated.
Dan
[[alternative HTML version deleted]]
2011 Aug 06
0
ridge regression - covariance matrices of ridge coefficients
...(X)
ym <- mean(y)
X <- X - rep(Xm, rep(n, p))
y <- y - ym
#scale X, as in MASS::lm.ridge
Xscale <- drop(rep(1/n, n) %*% X^2)^0.5
X <- as.matrix(X/rep(Xscale, rep(n, p)))
XPX <- crossprod(X)
XPy <- crossprod(X,y)
I <- diag(p)
lmfit <- lm.fit(X, y)
MSE <- sum(lmfit$residuals^2) / (n-p)
# prepare output
coef <- matrix(0, length(lambda), p)
cov <- as.list(rep(0, length(lambda)))
mse <- rep(0, length(lambda))
# loop over lambdas
for(i in seq(length(lambda))) {...
2012 Sep 06
0
lme( y ~ ns(x, df=splineDF)) error
...gdat$x
+ longdat$x^3
+ (longdat$x-1)^4 / 5
+ 1/(abs(longdat$x/50) + 0.02)
+ longdat$IDeffect
+ rnorm(1:nrow(longdat)) * 2
)
longdat<-longdat[order(longdat$x),]
library(splines)
# Calling ns within lm works fine:
mylm<- lm( y ~ ns(x,df=splineDF), data=longdat)
longdat$lmfit<-predict(mylm)
library(ggplot2)
print(
ggplot(longdat, aes(x, y))
+ geom_point(shape=1)
+ geom_line(aes(x=x, y=lmfit), color="red")
)
cat("Enter to attempt lme.")
readline()
library(nlme)
if(WhichApproach==1) {
# returns: "Error in eval(expr, envir, enclos) : ob...
2011 Nov 22
2
filtering probesets with Bioconductor?
...file.
Can anyone tell me how I would begin to approach this? I have looked into
using the genefilter() function but can't figure out if it can take the
right parameters (i.e. specific probe set id's).
Thanks in advance,
-M
This is the code I used to generate my topTable
> fit <- lmFit(eset, design)
> cont.matrix <- makeContrasts(NormalvsTumor=Tumor-Normal, levels=design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2 <- eBayes(fit2)
> topTable(fit2, number=100, adjust="BH")
--
View this message in context: http://r.789695.n4.nabble.com/filterin...