我们想运行一个模型,以找到自变量的最佳组合来预测我的因变量。 为此,我想创建一个循环,通过排除/分配NULL值来测试变量的不同组合。
这里是2个变量的代码测试,但是我们无法为变量分配NULL值,并且会出现错误:
void customerlogin()
{
system("cls");
FILE* ptr;
ptr = fopen("record.txt", "r");
printf("\nAccount number: ");
scanf("%d", &check.acc_no);
printf("Username: ");
scanf("%s", check.name);
printf("Password: ");
scanf("%s", check.password);
int checkcredential, choose, findacct, login;
choose = 0;
checkcredential = 0;
findacct = 0;
login = 0;
while (fscanf(ptr, "%d %s %s %s %s %d/%d/%d %d %s %s %lf %s %f %d/%d/%d\n", &add.acc_no, add.password, add.repassword, add.user, add.name, &add.dob.month, &add.dob.day, &add.dob.year, &add.age, add.address, add.gender, &add.phone, add.acc_type, &add.amt, &add.deposit.month, &add.deposit.day, &add.deposit.year) != EOF)
{
if (check.acc_no == add.acc_no)
{
if (strcmp(check.name, add.name) == 0)
{
if (strcmp(check.password, add.password) == 0)
{
fclose(ptr);
login = 1;
customer(check.acc_no);
}
else
{
checkcredential = 1;
}
}
else
{
checkcredential = 1;
}
}
else
{
findacct = 1;
}
}
fclose(ptr);
if (login == 0)
{
if (findacct == 1 || checkcredential == 1)
{
printf("\nSorry, wrong credentials!\n\nEnter 1 to try again and 0 to exit:");
scanf("%d", &main_exit);
system("cls");
if (main_exit == 1)
{
customerlogin();
}
else if (main_exit == 0)
{
exit(0);
}
}
}
}
void customer()
{
printf("/n Login Successful!");
}
Error in model.frame.default(formula = rating ~ releasey + duration1, : invalid type (NULL) for enter code here`variable 'releasey'