This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Linear model error: fitted()

Hello,

I'm trying to use the fitted() function in order to retrieve the fitted (predicted) value of D2R at each value in G. I've tried the following R syntax but don't understand why I'm receiving the following error?

plot( fitted( lm.34852.g.at),
     d2r.34852[is.na(d2r.34852$D2R),"D2R"],
     xlab = "Fitted", ylab = "Observed")

 

Error in xy.coords(x, y, xlabel, ylabel, log) : 
      'x' and 'y' lengths differ

I've also tried separating the plot and fitted() portion of the code but still cannot seem to get this code to work correctly?

r linear model

Hello oars!

We believe that this post does not fit the main topic of this site.

This is a pure R question and the error mesage is quite self-explanatory. Please search StackOverflow

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

Thanks Ram. I actually figured it out. I needed to add an ! before the is.

plot( fitted( lm.34852.g.at),d2r.34852[!is.na(d2r.34852$D2R),"D2R"],xlab="Fitted",ylab="Observed")

I'll try to keep my posts more in the bioinformatics lane in the future.

0 answers

No answers yet.

Log in to answer this question.