[程式] R:請問如何寫出l<- lm(weight ~ group)?已刪文

看板Statistics作者 (ml919)時間2月前 (2024/02/20 07:58), 編輯推噓0(001)
留言1則, 1人參與, 2月前最新討論串1/1
請教各位! 請問要如何寫出類似這樣的function, 以linear regression為例: lm.D9 <- lm(weight ~ group) lm.D90 <- lm(weight ~ group - 1) anova(lm.D9) summary(lm.D90) 或是像mgcv package lr.fit1 <- gam(y~s(x0)+s(x1)+s(x2),family=binomial, data=dat,method="REML") 有自變數, 有因變數, 有 ~ 請問這種函式該怎麼寫? 有什麼書籍可以參考嗎? 或google搜尋, 關鍵字應該打什麼? 感謝!!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 173.91.250.199 (美國) ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1708387122.A.591.html

02/21 10:11, 2月前 , 1F
我的話 會去查詢R lm GitHub
02/21 10:11, 1F
文章代碼(AID): #1bq-ioMH (Statistics)