I need to attend the Anvisa Gui 10 that asks for a specific weighting

Asked

Viewed 69 times

-3

Guide 10 of the National Health Surveillance Agency recommends that if the residual variances are heterocedastic we must use the following weighting factor:

wi=((1/Si^2)/((Somatório de 1/Si^2)/n)

My data is:

x=c(80,80,80,90,90,90,100,100,100,110,110,110,120,120,120)
y=c(7752365,7747524,7852362,9012556,9322541,9033562,10025368,10025558,10024986,11112541,11022574,10999854,12016525,12021254,12018741)

The most I could get was this:

VarCond <- aggregate(df$y, list(df$x), var)$x
qtde_x <- as.numeric(table(df$x))
pesos <- rep(1/VarCond, qtde_x)
ajustew <- lm(y ~ x, data=df, weights=pesos)
summary(ajustew)

I can’t go any further.

  • 1

    Good evening! I suggest that you put an expected output of the data, so whoever tries to solve the problem will have where to consult. Hug!

  • I would say that the problem with these data is not heterocedasticity. The double observations (90, 9322541) is a point of influence. It seems to indicate that the variance of the residues is not constant. When removing it from the data set (is the 5th observation), the adjustment is well behaved. I would investigate further what happened to this case and, depending on the situation, I would choose to remove it, even with a small imbalance in the experiment.

  • Thank you Marcus, in fact these are fictitious data created to run the script, the problem is that I can not build the weighting factor as requested by Anvisa

1 answer

2

Of ANVISA Guide 10, page 9:

If the individual points are marked by (X1, Y1), (x2, Y2), (X3, Y3)... (xi, yi)... (Xn, yn), the corresponding standard deviations are s1, s2, s3 ... si ... sn. Individual weights can then be defined, w1, w2, w3 ... wi ... wn, as being:

formula

Thus:

s <- aggregate(y, list(x), sd)$x
n <- length(s)
w <- s^-2 / (sum(s^-2) / n)

pesos <- rep(w, table(x))
ajustew <- lm(y ~ x, weights = pesos)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.