Hey
i'm a engineering student from new zealand. In our mathematical modelling paper there is a small statistics section, which i am not too confident in.
Most of our work is using R, except the notes we are given are very vague and i'm getting confused reading them.
Anyway, i have a set of data for men and women who exercise. In this table there is 6 different columns, the 'subject (ie. person) number', 'gender', 'measured weight', 'measured height', 'reported weight' (the weight that the subject thinks they are) and 'reported height' (the height the person thinks they are).
The question im trying to answer is: "Determine whether there is a difference between the measured weight and reported weight of women"
Now, is this paired data? im pretty sure it is.. because it's from the same sample, same conditions, and same amount of subjects?
Thinking that this was the case i continued on, following the vague course book material.
what i did was:
-made a data-vector called 'f.mwt' which is the measured weight of the females in the sample
-made a data-vector called 'f.rwt' which is the reported weight of the females in the sample
-made another data-vector called 'w.diff' which is the difference between the two vectors (by subtraction)
-did a qqnorm plot for normality and fitted it with a straight line, in which case i got this:
i thought that this didn't look exactly normal but close, so i did a shapiro-wilk test and got a p-value of 1.692e-05, which is basically good enough to throw away any assumption of normaility isn't it?
in class, when we found a sample that wasn't normal we did a transformation (are you allowed to do this for paired data?). I thought i might as well try it.
The first thing we did was take a boxcoxplot of the data, to obtain a number off the graph and then do the transformation from there.
But when i try to do a boxcoxplot, using the entry "boxcoxplot(w.diff)" i get the following error;
"Error in var(power.trans(x, p)) : missing observations in cov/cor
In addition: Warning message:
NaNs produced in: log(x) "
I have no idea what this error means and i've been searching frantically on the internet to find a solution.
Has anyone here had this error before? Have i done something wrong? Is this even the way that you're meant to solve paired samples?
any help would be appreciated
thanks
-brad
Most of our work is using R, except the notes we are given are very vague and i'm getting confused reading them.
Anyway, i have a set of data for men and women who exercise. In this table there is 6 different columns, the 'subject (ie. person) number', 'gender', 'measured weight', 'measured height', 'reported weight' (the weight that the subject thinks they are) and 'reported height' (the height the person thinks they are).
The question im trying to answer is: "Determine whether there is a difference between the measured weight and reported weight of women"
Now, is this paired data? im pretty sure it is.. because it's from the same sample, same conditions, and same amount of subjects?
Thinking that this was the case i continued on, following the vague course book material.
what i did was:
-made a data-vector called 'f.mwt' which is the measured weight of the females in the sample
-made a data-vector called 'f.rwt' which is the reported weight of the females in the sample
-made another data-vector called 'w.diff' which is the difference between the two vectors (by subtraction)
-did a qqnorm plot for normality and fitted it with a straight line, in which case i got this:

i thought that this didn't look exactly normal but close, so i did a shapiro-wilk test and got a p-value of 1.692e-05, which is basically good enough to throw away any assumption of normaility isn't it?
in class, when we found a sample that wasn't normal we did a transformation (are you allowed to do this for paired data?). I thought i might as well try it.
The first thing we did was take a boxcoxplot of the data, to obtain a number off the graph and then do the transformation from there.
But when i try to do a boxcoxplot, using the entry "boxcoxplot(w.diff)" i get the following error;
"Error in var(power.trans(x, p)) : missing observations in cov/cor
In addition: Warning message:
NaNs produced in: log(x) "
I have no idea what this error means and i've been searching frantically on the internet to find a solution.
Has anyone here had this error before? Have i done something wrong? Is this even the way that you're meant to solve paired samples?
any help would be appreciated
thanks
-brad
Last edited: