{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/141","repository_url":"https://api.github.com/repos/JuliaStats/GLM.jl","labels_url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/141/comments","events_url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/141/events","html_url":"https://github.com/JuliaStats/GLM.jl/issues/141","id":157298675,"number":141,"title":"\"predict\" method does not keep NA values","user":{"login":"JessicaYK","id":8303445,"avatar_url":"https://avatars.githubusercontent.com/u/8303445?v=3","gravatar_id":"","url":"https://api.github.com/users/JessicaYK","html_url":"https://github.com/JessicaYK","followers_url":"https://api.github.com/users/JessicaYK/followers","following_url":"https://api.github.com/users/JessicaYK/following{/other_user}","gists_url":"https://api.github.com/users/JessicaYK/gists{/gist_id}","starred_url":"https://api.github.com/users/JessicaYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JessicaYK/subscriptions","organizations_url":"https://api.github.com/users/JessicaYK/orgs","repos_url":"https://api.github.com/users/JessicaYK/repos","events_url":"https://api.github.com/users/JessicaYK/events{/privacy}","received_events_url":"https://api.github.com/users/JessicaYK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-27T22:05:28Z","updated_at":"2016-05-30T17:51:47Z","closed_at":null,"body":"Hi all,\r\n\r\nThe data that I use contains variables with some \"NA\" values. I need to run regressions on them, and I want my prediction to show the positions of variables that have predictions as \"NA\". However, the \"predict\" method does not do this. It only shows the vector consisting of non-NA predictions. Is there a way I can show NA predictions? Any help will be appreciated!"},"comment":{"url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/comments/222534078","html_url":"https://github.com/JuliaStats/GLM.jl/issues/141#issuecomment-222534078","issue_url":"https://api.github.com/repos/JuliaStats/GLM.jl/issues/141","id":222534078,"user":{"login":"andreasnoack","id":505001,"avatar_url":"https://avatars.githubusercontent.com/u/505001?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasnoack","html_url":"https://github.com/andreasnoack","followers_url":"https://api.github.com/users/andreasnoack/followers","following_url":"https://api.github.com/users/andreasnoack/following{/other_user}","gists_url":"https://api.github.com/users/andreasnoack/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasnoack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasnoack/subscriptions","organizations_url":"https://api.github.com/users/andreasnoack/orgs","repos_url":"https://api.github.com/users/andreasnoack/repos","events_url":"https://api.github.com/users/andreasnoack/events{/privacy}","received_events_url":"https://api.github.com/users/andreasnoack/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T17:51:47Z","updated_at":"2016-05-30T17:51:47Z","body":"The best way is to provide a small piece of code that can be copied into the Julia and executed. In that way, it's typically easy to see the problem and propose a solution. In your case, something like\r\n```jl\r\njulia> using DataFrames\r\n\r\njulia> df = DataFrame(x = randn(10), y = randn(10));\r\n\r\njulia> df[:y][1] = NA;\r\n\r\njulia> predict(lm(y~x, df), [ones(10) df[:x]])\r\n10-element Array{Float64,1}:\r\n  0.144802\r\n -0.13223 \r\n  0.284572\r\n -0.511882\r\n  0.11762 \r\n  0.190414\r\n -0.553935\r\n  0.048628\r\n -0.01136 \r\n  0.548038\r\n```\r\nmight have shown what you were asking about.\r\n\r\nI don't really see how you can predict that the `y` element is `NA`. The prediction is a function of the `x`s and the parameters. It sounds as if your `x` doesn't have `NA`s and then either none or all of the elements in `y` would be `NA` depending on whether there are `NA`s in the regression coeffients or not."}}
{"actor":{"display_login":"andreasnoack"}}