refunders / refund

Regression with functional data
39 stars 23 forks source link

variable length of predictors #73

Closed mkulbaba closed 5 years ago

mkulbaba commented 8 years ago

Hello,

I am using the Refund package to address a biological question:

I am wanting to perform a functional regression of fruit set (scalar response) along gradients of traits within plant flowering stems (continuous floral traits along a stem). The issue I am having results from the plants I sampled having a variable number of flowers per stem (as expected). This results in the predictors for each individual plant having different lengths (see attached data file: flwmat0.txt), as well as some missing values.

The number of flowers per stem ranges from 2 to 107 (see variable nflowers in attached data file: frtmat0.txt). Therefore, when I prepare my matrix for analysis all plants are assigned to have 107 flowers, and those with less have the remainder of the flower fields filled with NAs. It is no surprise that I then receive an error message "Not enough (non-NA) data to do anything meaningful" when I attempt to use the pfr function in Refund.

Finally, my question: is there any way to differentiate between actual missing data (real NAs) and data that just does not exist? Said differently, can the predictors have a different number of values across individuals?

Sorry for the long message,

Mason

flwmat0.txt frtmat0.txt

mkulbaba commented 8 years ago

Sorry for the multiple posts, I (finally) came across the variable-domain function (lf.vd) available in Refund. This seems to take care of the issue. My apologies for not thoroughly searching the documentation.

Mason