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

64 views
Skip to first unread message

Alina Vodonos

unread,
Sep 21, 2014, 8:26:12 AM9/21/14
to israel-r-...@googlegroups.com
שלום לכולם!

אני רוצה לעשות פלוט המבוסס על מודל:

mod <- gam(ACS_sum~PM10avg+s(RHavg,k=4,fx=TRUE)+s(time,k=4,fx=TRUE)+s(tempavg,k=4,fx=TRUE), family=poisson, data=ACS, na.action=na.omit(

 

predmod1 <- predict(mod)

plot(ACS$PM10avg, ACS$ACS_sum) ## Working J

points(ACS$PM10avg, predmod1, pch=17,col=3)## Here i get an error

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

 

 

ניסיתי לקרוא על הטעות הזאת, ובדקתי שהערכים שלי בעלי אותו אורך:

> length(PM10avg)
[1] 3652
> length(ACS_sum)
[1] 3652

 

אז מה יכולה להיות הבעיה?

 

תודה

אלינה

Tal Galili

unread,
Sep 21, 2014, 8:39:21 AM9/21/14
to israel-r-...@googlegroups.com
שלום אלינה,
תבדקי בבקשה את האורכים של:

ACS$PM10avg, predmod1


On Sun, Sep 21, 2014 at 3:26 PM, Alina Vodonos <alina....@gmail.com> wrote:
ACS$PM10avg, predmod1




----------------Contact Details:-------------------------------------------------------
Contact me: Tal.G...@gmail.com
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

Alina Vodonos

unread,
Sep 21, 2014, 11:24:09 AM9/21/14
to israel-r-...@googlegroups.com
אתה צודק גל,
הם לא שווים

> length(ACS_TS$PM10avg)
[1] 3652
> length(ACS_TS$Primary_ACS_sum)
[1] 3652
> length(predmod1)
[1] 3538


איך אומרים לו לעשות רק לאורך משותף?

Tal Galili

unread,
Sep 21, 2014, 11:48:21 AM9/21/14
to israel-r-...@googlegroups.com
נראה לי שכדאי לוודא למה הם לא באותו האורך... 
(נאמר, בגלל תצפיות חסרות)

טל

Sent from a smart-phone
--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alina Vodonos

unread,
Sep 21, 2014, 1:31:46 PM9/21/14
to israel-r-...@googlegroups.com
כן, זה בגלל התצפיות החסרות
ניסיתי לכתוב בפקודה na.rm="T"
אבל לא עבד
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsub...@googlegroups.com.

Tal Galili

unread,
Sep 21, 2014, 1:52:58 PM9/21/14
to israel-r-...@googlegroups.com
אולי כדאי לטפל בתצפיות החסרות בנתונים המקוריים. לדוגמא בעזרת הפונקציה na.omit עליהם...


----------------Contact Details:-------------------------------------------------------
Contact me: Tal.G...@gmail.com
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)
----------------------------------------------------------------------------------------------


To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages