This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc import out = modelsample | |
datafile = "C:\Users\User\Desktop\三田論\mitaron_conditional_probit1113.csv" | |
dbms=csv REPLACE; | |
getnames=yes; | |
datarow=2; | |
run; | |
proc print data=modelsample(obs=30); | |
run: | |
data model(keep=id week year month day brand uicp sicp qicp kicp picp price cm sns price_rihanari cm_rihanari sns_rihanari choice chosen demo_icp age sex marry income1 income2 ); | |
/*切片*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data | |
{ | |
int<lower=0> N; //サンプルサイズ(ユニークな個人) | |
int<lower=0> NT; //サンプルサイズ(全体) | |
int<lower=0, upper=1> y[NT]; //目的変数(離反) | |
int id[NT]; //ユニークな個人の数 | |
vector[2] x[NT]; //切片と価格 | |
vector[10] w[NT]; //環境変数 | |
matrix[N,4] z; //属性 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("E:/TokyoR/JapanR2015") | |
library(rstan) | |
#stanファイル名 | |
scr <- "mitaronstandraft.stan" | |
d <- read.csv("sample.csv") | |
#ユニークな個人の情報 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submit/R; | |
library(RMeCab); | |
result <- RMeCabC("私は統計学を勉強しています。"); | |
result | |
endsubmit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*自分で設定*/ | |
-RLANG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-config "C:\Program Files\SASHome\SASFoundation\9.4\nls\ja\sasv9.cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: The RLANG system option must be specified in the SAS configuration file or on the SAS invocation command line | |
to enable the submission of R language statements. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROC IML; | |
submit/R; | |
library(RMeCab); | |
result <- RMeCabC("私は大学に通っています。"); | |
result | |
endsubmit; | |
run; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*推定用データ*/ | |
proc import out = modelsample | |
datafile = "C:\Users\User\Desktop\三田論\mitaron_conditional_probit1115_suitei.csv" | |
dbms=csv REPLACE; | |
getnames=yes; | |
datarow=2; | |
run; | |
proc print data=modelsample(obs=30); | |
run: | |
data model(keep=id week year month day /*brand*/ uicp sicp qicp kicp picp price cm sns price_rihanari cm_rihanari sns_rihanari choice chosen demo_icp age sex marry income1 income2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc iml; | |
submit/R; | |
iris; | |
endsubmit; | |
run ImportDataSetFromR("work.iris","iris"); | |
quit; | |
proc print data=iris(obs=30) /*データの確認(変数名など)*/ | |
run; |
OlderNewer