This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to adjust counts for age and gender?

Hi everyone,

I am currently doing research related to smallRNAs and I have a data set where I have around 50 smallRNAs (rnaseq) in close to 100 samples.

sample data looks like:

age     srna1     srna2     srna3     srna4     srna5     gender     smoker     disease
51     0          512       67        186       83        1          1          1
53     18         3449      112       422       54        2          1          1
48     0          69        0         9         0         1          1          0
55     0          966       38        64        47        2          1          1

I have to look for differences between disease(n1) and controls(n2) along with age and gender information. I have been reading in papers where the authors are talking about adjusting counts for age and gender.

I tried to perform logistic regression taking age and gender as covariates. However, I am confused now as how to get the adjusted (for age and gender) counts.

# Read the dataset in a dataframe
d <- read.table("input_file.txt", header=T, sep="\t")

# Extract the filtered Srna`s
fSrna <- subset(d, select=-c(age, gender, smoker, disease))
Y <- cbind()
for (i in names(fSrna)){Y=cbind(Y, fSrna[[i]])}

# Perform logistic regression
glmresults <- glm(disease ~ age + gender + Y, family=binomial(link="logit"), data=d)

names(glmresults)
 [1] "coefficients"      "residuals"         "fitted.values"    
 [4] "effects"           "R"                 "rank"             
 [7] "qr"                "family"            "linear.predictors"
[10] "deviance"          "aic"               "null.deviance"    
[13] "iter"              "weights"           "prior.weights"    
[16] "df.residual"       "df.null"           "y"                
[19] "converged"         "boundary"          "model"            
[22] "call"              "formula"           "terms"            
[25] "data"              "offset"            "control"          
[28] "method"            "contrasts"         "xlevels"

I would be glad if someone can help me to understand this more clearly and provide directions to calculate the adjusted or corrected counts for the smallRNAs.

Related biostar posts:

Thanks in advance.

covariates confounding

1 answer

There's no need to obtain an adjusted count, the entire purpose of using age and gender as covariates is so you don't have to do that. If you really had a good reason to adjust the counts (this is unlikely), then what you'd do is measure the effect due to each and adjust the initial values to offset that. Make sure to take into account the age:gender interaction.

Thanks a lot Devon.

I need to perform some downstream analysis on the adjusted counts that`s why I need the adjusted counts.

As per your suggestion, in order to get the adjusted counts, I should take the values from the "effects" i.e. glmresults["effects"] and multiply with the raw counts for corresponding smallRNA. Is this the right approach?

That's at least what I'd do. If you take the results and put them through the same analysis then the resulting coefficients should be around 0 (otherwise, something went wrong). I'd recommend trying that to ensure that the adjustment was done correctly.

Thanks a lot. I will do the above mentioned analysis and check it if the adjustment was done correctly. Big thanks for your help.

Log in to answer this question.