{"action":"created","issue":{"url":"https://api.github.com/repos/lebebr01/simglm/issues/31","repository_url":"https://api.github.com/repos/lebebr01/simglm","labels_url":"https://api.github.com/repos/lebebr01/simglm/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/lebebr01/simglm/issues/31/comments","events_url":"https://api.github.com/repos/lebebr01/simglm/issues/31/events","html_url":"https://github.com/lebebr01/simglm/issues/31","id":217647491,"number":31,"title":"Allow factor variables in the random component?","user":{"login":"jknowles","id":1310474,"avatar_url":"https://avatars3.githubusercontent.com/u/1310474?v=3","gravatar_id":"","url":"https://api.github.com/users/jknowles","html_url":"https://github.com/jknowles","followers_url":"https://api.github.com/users/jknowles/followers","following_url":"https://api.github.com/users/jknowles/following{/other_user}","gists_url":"https://api.github.com/users/jknowles/gists{/gist_id}","starred_url":"https://api.github.com/users/jknowles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jknowles/subscriptions","organizations_url":"https://api.github.com/users/jknowles/orgs","repos_url":"https://api.github.com/users/jknowles/repos","events_url":"https://api.github.com/users/jknowles/events{/privacy}","received_events_url":"https://api.github.com/users/jknowles/received_events","type":"User","site_admin":false},"labels":[{"id":26167160,"url":"https://api.github.com/repos/lebebr01/simglm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lebebr01/simglm/milestones/1","html_url":"https://github.com/lebebr01/simglm/milestone/1","labels_url":"https://api.github.com/repos/lebebr01/simglm/milestones/1/labels","id":2486881,"number":1,"title":"CRAN Submission v0.5.0","description":"Working toward CRAN submission by end of May. The version will be 0.5.0.","creator":{"login":"lebebr01","id":2414730,"avatar_url":"https://avatars2.githubusercontent.com/u/2414730?v=3","gravatar_id":"","url":"https://api.github.com/users/lebebr01","html_url":"https://github.com/lebebr01","followers_url":"https://api.github.com/users/lebebr01/followers","following_url":"https://api.github.com/users/lebebr01/following{/other_user}","gists_url":"https://api.github.com/users/lebebr01/gists{/gist_id}","starred_url":"https://api.github.com/users/lebebr01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lebebr01/subscriptions","organizations_url":"https://api.github.com/users/lebebr01/orgs","repos_url":"https://api.github.com/users/lebebr01/repos","events_url":"https://api.github.com/users/lebebr01/events{/privacy}","received_events_url":"https://api.github.com/users/lebebr01/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2017-04-27T19:54:31Z","updated_at":"2017-05-23T19:56:14Z","due_on":"2017-05-31T07:00:00Z","closed_at":null},"comments":1,"created_at":"2017-03-28T18:15:29Z","updated_at":"2017-05-23T19:56:14Z","closed_at":"2017-05-23T19:56:13Z","body":"Is it possible to specify a factor in the random component? \r\n\r\nI want to generate data where some of the variables are factors which are consistent within cluster. \r\n```\r\nfixed <- ~1 + time \r\nrandom <- ~1 + time + gifted.f + iep.f + frpl.f + ell.f \r\nrandom3 <- ~ 1\r\nfixed_param <- c(100, 25, 10)\r\nfact_vars <- list(numlevels = c(2, 2, 2, 2),  var_type = c(rep('lvl2', 4)))\r\nrandom_param <- list(random_var = c(50, 90, 10, 10, 10, 10), rand_gen = \"rnorm\") \r\nrandom_param3 <- list(random_var = c(200), rand_gen = 'rnorm') \r\nunbalCont <- c(2, 16)\r\nunbalCont3 <- c(100, 800)\r\nk <- 15 \r\nn <- 200\r\np <- 400\r\nerror_var <- 10\r\nwith_err_gen <- 'rnorm'\r\nlvl1_err_params <- list(mean = 20, sd = 10)\r\ndata_str <- \"long\"\r\ncov_param <- NULL\r\ntemp_three <- sim_reg(fixed = fixed, random = random, random3 = random3,\r\n                      fixed_param = fixed_param, random_param = random_param,\r\n                      random_param3 = random_param3, cov_param = cov_param,\r\n                      fact_vars = fact_vars, k = k,n = n, p = p,\r\n                      lvl1_err_params = lvl1_err_params,\r\n                      error_var= error_var, with_err_gen = with_err_gen,\r\n                      cor_vars = cor_vars, data_str = data_str, unbal = TRUE,\r\n                      unbalCont = unbalCont, unbalCont3 = unbalCont3)\r\n```\r\n\r\nI don't understand what I'm doing wrong in specifying this. Is it just that putting factors in the 2nd or 3rd level is not possible currently?"},"comment":{"url":"https://api.github.com/repos/lebebr01/simglm/issues/comments/303513723","html_url":"https://github.com/lebebr01/simglm/issues/31#issuecomment-303513723","issue_url":"https://api.github.com/repos/lebebr01/simglm/issues/31","id":303513723,"user":{"login":"lebebr01","id":2414730,"avatar_url":"https://avatars2.githubusercontent.com/u/2414730?v=3","gravatar_id":"","url":"https://api.github.com/users/lebebr01","html_url":"https://github.com/lebebr01","followers_url":"https://api.github.com/users/lebebr01/followers","following_url":"https://api.github.com/users/lebebr01/following{/other_user}","gists_url":"https://api.github.com/users/lebebr01/gists{/gist_id}","starred_url":"https://api.github.com/users/lebebr01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lebebr01/subscriptions","organizations_url":"https://api.github.com/users/lebebr01/orgs","repos_url":"https://api.github.com/users/lebebr01/repos","events_url":"https://api.github.com/users/lebebr01/events{/privacy}","received_events_url":"https://api.github.com/users/lebebr01/received_events","type":"User","site_admin":false},"created_at":"2017-05-23T19:56:13Z","updated_at":"2017-05-23T19:56:13Z","body":"Upon thinking about this in more detail, this model does not make sense to me. The random effects should be continuous not factors. Therefore, adding factors in the random component is not possible or meaningful.\r\n\r\nIf you'd like to generate data in which there are subject specific deviations for ELL or gifted students, why not treat these as fixed which is more common? The grouping is not random, the students are random."}}
{"actor":{"display_login":"lebebr01"}}