GLM: Capturing stander error (SE) of the estimate

Questions about GenABEL (aka *ABEL) suite of packages
Forum rules
Please remember not to post any sensitive data on this public forum.
The first few posts of newly registered users will be moderated in order to filter out any spammers.

When get a solution to the problem you posted, please change the topic name (e.g. from "how to ..." to "[SOLVED] how to ..."). This will make it easier for the community to follow the posts yet to be attended.
GerardTromp
Posts: 5
Joined: Fri Jun 24, 2011 5:52 pm

GLM: Capturing stander error (SE) of the estimate

Postby GerardTromp » Tue Feb 25, 2014 1:32 am

scan.glm is marvelous, except I don't seem to be able to capture the standard error of the estimate for a SNP effect. I have been looking through the manuals and tutorials and I apologize if I missed it.

It seems that both the estimate of the effect and its standard error are important statistics.

Does anyone know if it is captured anywhere. It seems PredictABEL does output the SE of the estimate, but I am unsure how to apply it the genotyped data (i.e, not imputed).

lzhao
GenABEL suite user
GenABEL suite user
Posts: 10
Joined: Thu Jan 23, 2014 8:56 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby lzhao » Fri Mar 07, 2014 7:08 pm

This may be a silly question. I am using scan.glm, as the following:

> ccdata_Add.glm=scan.glm("CASE_STATUS~sex*CRSNP",data=anadata,family=binomial(),snps=(1:10))

It seems running fine, producing results. When trying to plot, using the following command:

> plot(ccdata_Add.glm)

It produces the following error message:

"Error in annotation(object) :
trying to get slot "annotation" from an object (class "scan.gwaa") that is not an S4 object "

Any suggestion?

lzhao
GenABEL suite user
GenABEL suite user
Posts: 10
Joined: Thu Jan 23, 2014 8:56 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby lzhao » Mon Mar 10, 2014 4:41 pm

It looks like that scan.glm produces S3 object. Is this a bug or an intended output from scan.glm?

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby yurii » Wed Mar 12, 2014 10:21 pm

I don't seem to be able to capture the standard error of the estimate for a SNP effect


as a quick fix: you can work SE out from P-values, e.g. if effect B=(-0.1) and p-value P=0.005 then SE of B is

Code: Select all

B <- (-0.1)
P <- 0.005
chi2 <- qchisq(P,df=1,lower=FALSE)
SE <- sqrt(B^2/chi2)
SE
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby yurii » Wed Mar 12, 2014 10:26 pm

Error in annotation(object) :
trying to get slot "annotation" from an object (class "scan.gwaa") that is not an S4 object


and

scan.glm produces S3 object. Is this a bug or an intended output from scan.glm?


This is a bug. Somebody needs to fix it :)

scan.glm is in many ways very suboptimal procedure; I must say I did not use scan.glm for years, and do not quite see the reason to use it; may be you can indicate why not using say mlreg or ProbABEL (if it comes to GxE and imputed data).

Let us know!
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii

lzhao
GenABEL suite user
GenABEL suite user
Posts: 10
Joined: Thu Jan 23, 2014 8:56 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby lzhao » Thu Mar 13, 2014 5:24 pm

I need to test interaction of SNPs with a covariate, hopefully, within R environment. This is the reason I am using scan.glm. If there is a quick fix, I would greatly appreciate.
:)

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby yurii » Fri Mar 14, 2014 2:47 pm

Here is a quick an ugly fix (please do test!)

Code: Select all

library(GenABEL)
library(GenABEL.data)
data(srdta)
a <- scan.glm("bt~sex+age+CRSNP",family=binomial(),data=srdta,snps=(1:10),bcast=2)
plot(a) # generates an error
newMapStaff <- sortmap.internal(a$chromosome,a$map)
plot(newMapStaff$cummap,-log10(a$P1df[newMapStaff$ix])) # should work
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii

lzhao
GenABEL suite user
GenABEL suite user
Posts: 10
Joined: Thu Jan 23, 2014 8:56 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby lzhao » Mon Mar 17, 2014 6:23 pm

Hi Yuri,
Thanks. The provided code does allow me to access intermediate results, to draw a simple scan plot. In order to display results meaningfully, like plot.scan.gwaa, would you provide me a bit more instruction on to add "colors" to separate chromosomes and to create axis labels, to annotate chromosomes? Thanks.

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: GLM: Capturing stander error (SE) of the estimate

Postby yurii » Mon Mar 17, 2014 7:32 pm

I think this goes a bit outside of the topic of this forum towards general R graphical capabilities.

In order to fix the graphics bug of scan.glm probably the best place to start with is by reading the source code of plot.scan.gwaa. If you figure out how to fix it, please consider submitting a patch, which will be greatly appreciated by the community. Otherwise even reporting this bug in our bug tracker will be already of help (if we have it documented, it is going to be eventually fixed - by some volunteer, or if one of us gets some grant money allowing to systematically go over all bugs).

If you decide to contribute to the project, information on our policies and technical details on how to do this are provided from the www.genabel.org, sections "for developers" and "how to contribute".

Best regards,
Yurii
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii


Return to “GenABEL”

Who is online

Users browsing this forum: No registered users and 1 guest