[問題] 請教二元變項隨機變數

看板R_Language作者 (galsuinda)時間6年前 (2019/02/03 08:37), 編輯推噓0(002)
留言2則, 2人參與, 6年前最新討論串1/1
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) 想用R建立一筆100個發生機率為0.2的二元變項隨機變數 [軟體熟悉度]: 完全新手 [問題敘述]: 如何建立此隨機變數 dbinom(x, 100, 0.2) x的部分不知道要用什麼值 第一步就卡住了 感謝指點 [程式範例]: 程式碼可貼於以下網站: http://ideone.com/ http://codepad.org http://pastie.org/ http://nopaste.info/ http://pastebin.com/ http://paste.plurk.com http://gist.github.com/ http://nopaste.csie.org/ [環境敘述]: 5.3.2 [關鍵字]: -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.230.170.98 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1549183041.A.40A.html

02/03 17:22, 6年前 , 1F
rbinom(100, 1, 0.2)
02/03 17:22, 1F

02/06 21:20, 6年前 , 2F
Thanks
02/06 21:20, 2F
文章代碼(AID): #1SLgX1GA (R_Language)
文章代碼(AID): #1SLgX1GA (R_Language)