BookmarkSubscribeRSS Feed
omerzeybek
Obsidian | Level 7

Hi i am trying to estimate a logic model. However my explanotary flag variables both include 0, "." (missing values) and  i need to code missing values as "0"

Because i have about 40 variables do you know an esay way yo solve this problem

3 REPLIES 3
plf515
Lapis Lazuli | Level 10

I am not sure what you mean by a "logic model" (perhaps logistic?) nor am I sure what you mean by "flag variables".

Furthermore, coding missing as 0 is often a mistake.

Nevertheless, if you want to do so you can do it in an array (the following code is not tested):

data new;

set old;

array misszero (*)  YOUR LIST OF VARIABLES HERE;

  do i = 1 to dim(misszero);

    if misszero(i) = . then misszero(i) = 0;

  end;

run;

omerzeybek
Obsidian | Level 7

yes i was trying to build a logistic regression

i am  trying to implement your code to my project but unfortunately still i couldnt make it

however thank you very much for your interest

plf515
Lapis Lazuli | Level 10

What do you mean 'couldn't make it'? What was the error message?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 779 views
  • 0 likes
  • 2 in conversation