Homework 4 FAQ

Q1: In the hw4dataset, what are the labels for the 9 columns? I think the
first two columns are for height and weight, but where can I find out
about the rest?

Q2: I don't know how to create a table in matlab. I created an array with 3
rows and 9 columns with all the values of the mean, median, and std from
hw4data, however I don't know how to tabulate them, and put a title, label
for column and row.

Q3: I had a question about the section for
computing the norm. I am able to calculate the predicted y-values from
the equations for both of my fits, but I really don't know how to
calculate the actual value from the scatter plot. Should I just eye the
plot, and estimate?

Q4: I had a slight problem with the [r,p]=corrcoef(...) command. When i
use this to try to get a p matrix that does the simple hypothesis
testing, the matrix returns a 2x2 identity matrix.

The command i used was simply

[r,p]=corrcoef(x,y)

%The output I recieved was

r =

1.0000 0.6612
0.6612 1.0000


p =

1.0000 0.0000
0.0000 1.0000


Is this correct? The correlation seems significant but the p matrix
that is returned is very odd.

Q5: I'm trying to do the scatterplot portion of HW 4 and I'm having a problem.


Im sure the answer is simple, but I can't figure out how to plot two
columns of the hw4data together on the scatterplot.

i tried:

scatterplot(hw4data(:,1;:,2))

and

h = hw4data(:,1)
w = hw4data(:,2)
scatterplot(h,w)

and niether of those worked. What syntax am i forgetting here?

Q6: F

Q7: F

Q8: I

Q9: E

Q10: I

Q11: W

Q12: I

Q13: H


A1: The data each column represents is explained in the homework assignment, page 3, section 2.2 - please read the entire assignment document carefully before going on.  Each step is explained.


A2:You can create the table in Word or excel (you aren't expected to create it in Matlab).  If you create the table in excel, please paste it into your Word (or other program) homework document.


A3: So it sounds like you're halfway there.  Basically you have the actual y-values right?  Now you have an equation which computes a y-value given a certain x-value.  So plug into that equation the x-data we have, compute a 'predicted' set of y-values, then subtract those from the actual y-data.  That vector (we'll call it 'Error' or 'E') is what you compute the norm of (using the command 'norm(E)' in matlab).  You'll get a number which represents a criterion for how closely the fit approximates the data.  Then you do this for each fit method, and you can compare those numbers.  TA-DA!!!!


A4: The zeros are not actually zero - type p(2,1) and you'll see that it's actually a really small number, not zero, so it's just VERY significant. The correlation coefficient should come out the same as with r=corrcoef(x,y), we're just adding the p calculation.  So if p is close to zero in an off-diagonal term, that means it's very low probability that you would get that correlation by chance, and that the correlation result is significant. 


A5:

h = hw4data(:,1)
w = hw4data(:,2)
plot(h,w,'*')

you use the plot command for this one, and format the linetype to be '*'


A6:


A7:


A8:


A9:


A10:


A11:


A12:


A13: