I want to show if a population of virus-hosts and viruses have the same proportion on certain characteristics.


Let's say there are 5 different "versions" of a protein (protA, protB, ...) of interest which can be produced by both, viruses and their host-organisms. Now, I have a large population of virus-hosts and I perfom some specific experiments to measure which of those 5 protein "versions" are present in the viruses and the hosts.

df <- data.frame(proteinX.version = LETTERS[1:5],
                 virus.host = round(rnorm(5,50,20),0),
                 virus = round(rnorm(5,50,20),0))

I'm only interested in the fraction of each version over all possible proteins versions for virus-hosts and viruses. Which results in something like that:

df$virus.host <- df$virus.host/sum(df$virus.host)
df$virus <- df$virus/sum(df$virus)



Finally I'd like to know if the fraction of each protein "version" correlates between viruses and their hosts. Or in other words, do viruses and their hosts produce the same amount of each protein version? i.e. Viruses produce 1:2:3:4:5 and virus-hosts 0.5:1:1.5:2:2.5 of protein version A:B:C:D:E respectively. How can I test if they significantly correlate?

What I tried

I did a comparison of population proportions on the fractions and the real counts. Where the fractions always lead to non-significance and the count data always to significant results.


However, I'm not quiet sure if this is the correct test. As far as I understood, it would need dichotomous variables...


Here is how I would do it:

Let the number of proteins of a certain type (p) by a strain of virus (v) be given by

Ln(p) = b0 + b1(v) + b2(v,p) + e

where b1(v) can vary between strains and b2(v,p) regulates excess production of a certain type.

Now the null hypothesis is b2(v,p) are jointly zero.

Now if you have the protein volumes, this can be estimated directly, though you will need to define one protein as the default in order to avoid collinearity. If you only have the shares, then you will need to estimate it via maximum likelihood as your shares equation will have multiple error terms. You can then use Wilk's theorem for significance testing. But it will be a major pain in the ass as the GRG problem will have a stupidly large number of unknowns.

  • $\begingroup$ I don't have an amount measurement per individuum - only binary measurements . like: virusX produces A and B but not the others. Analogous for the hosts. And I'm not interested in the amount of protein rather in the overall correlation in protein-type composition between viruses and hosts. $\endgroup$ – M. Del Jul 3 '19 at 16:53
  • $\begingroup$ Ok - then estimate the probability that a prot A . . . is produced by a given strain, under a given state (host ?). With a unique probability for each virus-state the estimate is just going to be the sample means. Now the null hypothesis is presumably that the probability is variant with state, but not by strain. The hypothesis is that the probability is variant across strains. As above you can use a likelihood ratio test. $\endgroup$ – Frustrated Jul 3 '19 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.