Skip to content

contourplot

3 messages · Steven LeBlanc, Pascal Oettli, David L Carlson

#
Hi,

What is the result of:

contourplot(Y~X1+X2,data=pr2)

HTH,
Pascal


Le 13/03/22 8:57, Steven LeBlanc a ?crit :
#
Look carefully at the help file. Your x1 and x2 need to define a rectangular
grid so that there is a value of y for each combination of different x1 and
x2 values. When this is not the case, you don't get an error, just a blank
plot. It is not clear from the little piece of data that you included if
that is the case, but the blank plot suggests that you don't have a grid.
You can created gridded data using expand.grid and predict.lm() to generate
estimates of y for every combination of x1 and x2:
----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352